diff options
author | makefu <github@syntax-fehler.de> | 2022-09-23 23:41:30 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2022-09-23 23:41:30 +0200 |
commit | 3e8f855f60dfa5bf56ab3a1d1a54e0accccbd618 (patch) | |
tree | 85674a93388edfb7a0646b46aafc18d64d7aa0c6 /makefu/2configs/home/ham/lib/default.nix | |
parent | 2dfde5dc6d37fb5bab8a1b658cfe7e5b21f5a2f4 (diff) |
ma ham: update
Diffstat (limited to 'makefu/2configs/home/ham/lib/default.nix')
-rw-r--r-- | makefu/2configs/home/ham/lib/default.nix | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/makefu/2configs/home/ham/lib/default.nix b/makefu/2configs/home/ham/lib/default.nix index 67e8e902d..cf1c32abd 100644 --- a/makefu/2configs/home/ham/lib/default.nix +++ b/makefu/2configs/home/ham/lib/default.nix @@ -14,7 +14,7 @@ in { service = "tts.google_say"; data = { - entity_id = entity; + entity_id = entity; inherit message; language = "de"; }; @@ -27,10 +27,7 @@ in #} { delay.seconds = 1; } { delay = '' - {% set duration = states.${entity}.attributes.media_duration %} - {% if duration > 0 %} - {% set duration = duration - 1 %} - {% endif %} + {% set duration = state_attr("${entity}","media_duration") %} {% set seconds = duration % 60 %} {% set minutes = (duration / 60)|int % 60 %} {% set hours = (duration / 3600)|int %} @@ -53,6 +50,10 @@ in inherit message; entity = "media_player.office"; }; + bedroom = message: tts { + inherit message; + entity = "media_player.bedroom"; + }; }; zigbee.prefix = "/ham/zigbee"; |