summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/bureautomation/multi/aramark.nix
blob: 45fadb08245a19dfe0bdaae2b43d01b19db6f350 (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
{ lib, ... }:
let
  aramark = topic: name:
  { platform = "mqtt";
    inherit name;
    state_topic = "/aramark/thales-deutschland/${topic}";
  };
  aramark_menue = menue:
  [
    (aramark "${menue}/title" menue)
    (aramark "${menue}/description" "${menue} Text")
   ((aramark "${menue}/price" "${menue} Preis") // { unit_of_measurement = "€"; })
  ];
in
  {
  services.home-assistant.config =
  {
    sensor = (aramark_menue "Menü 1")
          ++ (aramark_menue "Menü 2")
          ++ (aramark_menue "Mercato")
          ++ (aramark_menue "Aktion");
    binary_sensor =
    [
      ((aramark "pommes" "Pommes" ) // { payload_on = "True"; payload_off = "False"; })
    ];
  };
}