Skip to content

Commit ad1ac0d

Browse files
committed
Add different battery-level limits for different device-types
1 parent 3a19eae commit ad1ac0d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugwise/data.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ def _update_gw_devices(self) -> None:
6767
mac_list
6868
and "battery_state" in device["binary_sensors"]
6969
and device["zigbee_mac_address"] in mac_list
70-
and device["sensors"]["battery"] < 15
70+
and (
71+
(device["dev_class"] in ("thermo_sensor", "thermostatic_radiator_valve") and device["sensors"]["battery"] < 30)
72+
or (device["dev_class"] in ("zone_thermometer", "zone_thermostat") and device["sensors"]["battery"] < 15)
73+
)
7174
)
7275
if is_battery_low:
7376
device["binary_sensors"]["battery_state"] = True

0 commit comments

Comments
 (0)