summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/glados/switch/power.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2020-03-23 10:15:42 +0100
committerlassulus <lassulus@lassul.us>2020-03-23 10:15:42 +0100
commit8c27f12f86096f06e56333125eb6c713aece34ed (patch)
tree83d29ab23719468ff6e8d31f29963dd449edbef2 /krebs/2configs/shack/glados/switch/power.nix
parentcab3be8a19d445d3292454099dbc1ca97bca60c5 (diff)
parent8e3cd9fcffc473706a3ebafa5cb80f7a75c29aa5 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'krebs/2configs/shack/glados/switch/power.nix')
-rw-r--r--krebs/2configs/shack/glados/switch/power.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/krebs/2configs/shack/glados/switch/power.nix b/krebs/2configs/shack/glados/switch/power.nix
new file mode 100644
index 000000000..4e9a45c28
--- /dev/null
+++ b/krebs/2configs/shack/glados/switch/power.nix
@@ -0,0 +1,32 @@
+# 1 - haupt
+# 2 - dusche
+# 3 - warmwasser
+# 4 - or
+# 5 - kueche
+let
+ nodelight = type: ident: name: {
+ platform = "mqtt";
+ name = "${type} ${name}";
+ command_topic = "${type}/${toString ident}/command";
+ state_topic = "${type}/${toString ident}/state";
+ payload_on = "on";
+ payload_off = "off";
+ };
+ power = nodelight "power";
+ light = ident: name: { icon = "mdi:lightbulb";} // nodelight "light" ident name;
+in
+[
+ (power 1 "Hauptschalter")
+ (power 2 "Dusche")
+ (power 3 "Warmwasser")
+ (power 4 "Optionsräume")
+ (power 5 "Küche")
+ (light 1 "Decke Lounge 1")
+ (light 2 "Decke Lounge 2")
+ (light 3 "Decke Lounge 3")
+ (light 4 "Decke Lounge 4")
+ (light 5 "Decke Lounge 5")
+ (light 6 "Decke Lounge 6")
+ (light 7 "Decke Lounge 7")
+ (light 8 "Decke Lounge 8")
+]