diff options
Diffstat (limited to 'krebs/2configs/shack/glados/lib/default.nix')
-rw-r--r-- | krebs/2configs/shack/glados/lib/default.nix | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/krebs/2configs/shack/glados/lib/default.nix b/krebs/2configs/shack/glados/lib/default.nix index 6737af842..16cbc6830 100644 --- a/krebs/2configs/shack/glados/lib/default.nix +++ b/krebs/2configs/shack/glados/lib/default.nix @@ -2,6 +2,46 @@ let prefix = "glados"; in { + + 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 = "media_player.lounge"; + } + { service = "media_player.play_media"; + data = { + entity_id = "media_player.lounge"; + media_content_type = "playlist"; + media_content_id = "ansage"; + }; + } + { + service = "media_player.turn_on"; + data.entity_id = "media_player.lounge"; + } + { delay.seconds = 8; } + { service = "tts.say"; + entity_id = "media_player.lounge"; + data_template = { + inherit message; + language = "de"; + }; + } + ]; + in + { + lounge = message: tts { + inherit message; + entity = "lounge"; + }; + herrenklo = message: tts { + inherit message; + entity = "herrenklo"; + }; + }; esphome = { temp = {host, topic ? "temperature" }: |