summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/ham/lib/default.nix
blob: 45c86138b5d9ebca64e556bc744c88ce35fa5782 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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";
}