summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/ham/lib
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2021-03-09 22:14:51 +0100
committermakefu <github@syntax-fehler.de>2021-03-09 22:14:51 +0100
commitce2aadff1c8d1d44a51c3be27570c64e14fd13c1 (patch)
tree42ea3346ff62034aae8014e00d7f475f51276e6e /makefu/2configs/home/ham/lib
parent914163cec3b89e2abcbc58e535e648ac9788b305 (diff)
ma ham -> ma home/ham
Diffstat (limited to 'makefu/2configs/home/ham/lib')
-rw-r--r--makefu/2configs/home/ham/lib/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/makefu/2configs/home/ham/lib/default.nix b/makefu/2configs/home/ham/lib/default.nix
new file mode 100644
index 000000000..45c86138b
--- /dev/null
+++ b/makefu/2configs/home/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";
+}