summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/glados/sensors/power.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2020-12-30 09:13:07 +0100
committerlassulus <lassulus@lassul.us>2020-12-30 09:13:07 +0100
commite0bb61d3d3c2e053ab8c8c22f9cdded409ecece7 (patch)
treecb00a8eeead2d80cb05bc561005b8e9cf6edfb6a /krebs/2configs/shack/glados/sensors/power.nix
parentba47b90d7326c262f3e3327781a16fd8400df062 (diff)
parentc370c87da36bc256cfbc59bb2b0b9ffa1d457168 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'krebs/2configs/shack/glados/sensors/power.nix')
-rw-r--r--krebs/2configs/shack/glados/sensors/power.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/krebs/2configs/shack/glados/sensors/power.nix b/krebs/2configs/shack/glados/sensors/power.nix
index b168f2beb..d9b5c7c65 100644
--- a/krebs/2configs/shack/glados/sensors/power.nix
+++ b/krebs/2configs/shack/glados/sensors/power.nix
@@ -20,7 +20,10 @@ let
power_watt = (power_x "Power") ;
power_curr = power_x "Current";
in
+{
+ services.home-assistant.config.sensor =
(map power_volt [ "L1" "L2" "L3" ])
++ (map (x: ((power_watt x) // { device_class = "power"; })) [ "L1" "L2" "L3" ])
++ (map power_curr [ "L1" "L2" "L3" ])
-++ [ power_consumed ]
+++ [ power_consumed ];
+}