summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/ham/lib
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/2configs/ham/lib')
-rw-r--r--makefu/2configs/ham/lib/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/makefu/2configs/ham/lib/default.nix b/makefu/2configs/ham/lib/default.nix
new file mode 100644
index 000000000..45c86138b
--- /dev/null
+++ b/makefu/2configs/ham/lib/default.nix
@@ -0,0 +1,44 @@
+let
+ prefix = "/ham";
+in
+{
+ inherit prefix;
+ say = let
+ # returns a list of actions to be performed on an mpd to say something
+ tts = { message, entity }:
+ [
+ {
+ service = "media_player.turn_on";
+ data.entity_id = entity;
+ }
+ {
+ service = "media_player.play_media";
+ data = {
+ entity_id = entity;
+ media_content_type = "playlist";
+ media_content_id = "ansage";
+ };
+ }
+ {
+ service = "media_player.turn_on";
+ data.entity_id = entity;
+ }
+ { delay.seconds = 8; }
+ {
+ service = "tts.say";
+ entity_id = entity;
+ data_template = {
+ inherit message;
+ language = "de";
+ };
+ }
+ ];
+ in
+ {
+ firetv = message: tts {
+ inherit message;
+ entity = "firetv";
+ };
+ };
+ zigbee.prefix = "/ham/zigbee";
+}