summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2022-09-06 19:19:23 +0200
committertv <tv@krebsco.de>2022-09-06 19:19:23 +0200
commita4737bf4221e3f151f1376addbc9cbff2159b2b3 (patch)
tree47cef9d5c5b3be29063437404160d04f6c9088f1
parentda966f08d9bf23b929a02231df398aa92632f9c5 (diff)
parentd1fa957ed5bf60767c83c96135f9142f6c96ea50 (diff)
Merge remote-tracking branch 'prism/master'
-rw-r--r--makefu/1systems/omo/source.nix2
-rw-r--r--makefu/1systems/x/source.nix2
-rw-r--r--makefu/2configs/home/ham/automation/project_tracker.nix68
-rw-r--r--makefu/2configs/home/ham/default.nix1
-rw-r--r--makefu/5pkgs/awesomecfg/full.cfg4
5 files changed, 72 insertions, 5 deletions
diff --git a/makefu/1systems/omo/source.nix b/makefu/1systems/omo/source.nix
index b56e855fc..af508fbd6 100644
--- a/makefu/1systems/omo/source.nix
+++ b/makefu/1systems/omo/source.nix
@@ -1,6 +1,6 @@
{
name="omo";
torrent = true;
- unstable = true;
+ #unstable = true;
home-manager = true;
}
diff --git a/makefu/1systems/x/source.nix b/makefu/1systems/x/source.nix
index 05b74a014..ecb1d9962 100644
--- a/makefu/1systems/x/source.nix
+++ b/makefu/1systems/x/source.nix
@@ -3,7 +3,7 @@
full = true;
python = true;
hw = true;
- unstable = true;
+ # unstable = true;
mic92 = true;
clever_kexec = true;
home-manager = true;
diff --git a/makefu/2configs/home/ham/automation/project_tracker.nix b/makefu/2configs/home/ham/automation/project_tracker.nix
new file mode 100644
index 000000000..cb279b2fe
--- /dev/null
+++ b/makefu/2configs/home/ham/automation/project_tracker.nix
@@ -0,0 +1,68 @@
+{ lib, ... }:
+# uses:
+#
+let
+ at_work = "input_boolean.felix_at_work";
+ dice_action = "sensor.arbeitszimmer_cube_action";
+ project_sensor = "sensor.felix_project";
+ hlib = import ../lib;
+ say = hlib.say.office;
+ sides = [ "BDK" "LBS6" "random" "BNO" "CyberShield" "ILBS" ];
+ hist_stat = state: {
+ platform = "history_stats";
+ name = "Felix Project ${state}";
+ entity_id = project_sensor;
+ inherit state;
+ type = "time";
+ start = "{{ now().replace(hour=0, minute=0, second=0) }}";
+ end = "{{ now() }}";
+ };
+
+in
+ {
+ services.home-assistant.config.sensor = map hist_stat (sides ++ ["not at work" "unknown"]);
+ services.home-assistant.config.automation = [
+ { alias = "Felix Project Change";
+ trigger =
+ {
+ platform = "state";
+ entity_id = project_sensor;
+ # ignore login and log out
+ not_from = [ "not at work" ];
+ not_to = [ "not at work" ];
+ };
+
+ action = (say "Wechsel auf Projekt {{ trigger.to_state.state }}");
+ }
+ ];
+ services.home-assistant.config.template = [
+ {
+ trigger = [
+ {
+ platform = "state";
+ entity_id = at_work;
+ }
+ {
+ platform = "state";
+ attribute = "side";
+ entity_id = dice_action;
+ not_from = "";
+ }
+ ];
+ sensor = [
+ { name = "Felix Project";
+ state = ''
+ {% set at_work = states('${at_work}') == 'on' %}
+ {% set side = state_attr('${dice_action}','side') %}
+ {% if not at_work %}not at work
+ '' + (lib.concatImapStringsSep "\n" (i: project:
+ "{% elif side == ${toString (i - 1)} %}${project}") sides) +
+ ''
+ {% else %}unknown
+ {% endif %}
+ '';
+ }
+ ];
+ }
+ ];
+ }
diff --git a/makefu/2configs/home/ham/default.nix b/makefu/2configs/home/ham/default.nix
index f63ba3434..f54fd32f7 100644
--- a/makefu/2configs/home/ham/default.nix
+++ b/makefu/2configs/home/ham/default.nix
@@ -5,7 +5,6 @@
let
prefix = (import ./lib).prefix;
hassdir = "/var/lib/hass";
- unstable = import <nixpkgs-unstable> {};
in {
diff --git a/makefu/5pkgs/awesomecfg/full.cfg b/makefu/5pkgs/awesomecfg/full.cfg
index a86d3ac1f..430c9d511 100644
--- a/makefu/5pkgs/awesomecfg/full.cfg
+++ b/makefu/5pkgs/awesomecfg/full.cfg
@@ -488,8 +488,8 @@ awful.rules.rules = {
properties = { tag = tags[3] } },
{ rule = { class = "Signal" },
properties = { tag = tags[4] } },
- { rule = { class = "TelegramDesktop" },
- properties = { tag = tags[4] } },
+ -- { rule = { class = "TelegramDesktop" },
+ -- properties = { tag = tags[4] } },
{ rule = { class = "Element" },
properties = { tag = tags[4] } }
}