diff options
author | makefu <github@syntax-fehler.de> | 2019-09-25 14:05:38 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2019-09-25 14:05:38 +0200 |
commit | 2148318cd5342b986058e9efeab5a48855810d7b (patch) | |
tree | ccdcd546d3b0e32e63b2c1b30fbc9f352242d180 /makefu/2configs | |
parent | 4488358df385ed9a6c458553f44c2597c2c5d7af (diff) |
ma bureautomation/aramark: init
Diffstat (limited to 'makefu/2configs')
-rw-r--r-- | makefu/2configs/bureautomation/lib/scripts.nix | 18 | ||||
-rw-r--r-- | makefu/2configs/bureautomation/multi/aramark.nix | 24 |
2 files changed, 42 insertions, 0 deletions
diff --git a/makefu/2configs/bureautomation/lib/scripts.nix b/makefu/2configs/bureautomation/lib/scripts.nix new file mode 100644 index 000000000..d8665f94f --- /dev/null +++ b/makefu/2configs/bureautomation/lib/scripts.nix @@ -0,0 +1,18 @@ +{ lib, ... }: +{ + multi_flash = { entity, delays ? [ 500 ], alias ? "${entity}_multi_flash_${toString (lib.length delays)}" }: + { + inherit alias; + sequence = lib.flatten (builtins.map (delay: [ + { service = "homeassistant.turn_on"; + data.entity_id = entity; + } + { delay.milliseconds = delay; } + { service = "homeassistant.turn_off"; + data.entity_id = entity; + } + { delay.milliseconds = delay; } + ] + ) delays); + }; +} diff --git a/makefu/2configs/bureautomation/multi/aramark.nix b/makefu/2configs/bureautomation/multi/aramark.nix new file mode 100644 index 000000000..ebe2cde81 --- /dev/null +++ b/makefu/2configs/bureautomation/multi/aramark.nix @@ -0,0 +1,24 @@ +{ 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 +{ + 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"; }) + ]; +} |