summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/glados/lib/default.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2020-01-23 23:52:39 +0100
committermakefu <github@syntax-fehler.de>2020-01-23 23:52:39 +0100
commitc12411d79f21f6e462251d02485c8b2a139cb93e (patch)
tree4885196b4abaa0bd5ad497612a5660e41b617394 /krebs/2configs/shack/glados/lib/default.nix
parent6508c853da3596b701aa00e99a5260d31ebeaa24 (diff)
shack/glados: add shack-startup
Diffstat (limited to 'krebs/2configs/shack/glados/lib/default.nix')
-rw-r--r--krebs/2configs/shack/glados/lib/default.nix40
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" }: