os/hosts/giggles/home-assistant-customize-vacuum.nix
Hendrik Sokolowski 6c7d9704bd
All checks were successful
continuous-integration/drone/push Build is passing
latest changes
2023-11-11 01:24:25 +01:00

27 lines
592 B
Nix

let
mapSegments = [
{id = 1; name = "Hendrik";}
{id = 2; name = "Schlafzimmer";}
{id = 3; name = "Badezimmer";}
{id = 4; name = "Toilette";}
{id = 5; name = "Flur";}
{id = 6; name = "Vorratsraum";}
{id = 7; name = "Küche";}
{id = 8; name = "Caro";}
{id = 9; name = "Wohnzimmer";}
];
mkCustomize = id: [
{
name = "input_boolean.vacuum_segment_${toString id}";
value = {
room_id = id;
};
}
];
mkCustomizes = ms: builtins.concatMap (s: (mkCustomize s.id)) ms;
in
builtins.listToAttrs (mkCustomizes mapSegments)