Skip to content

Commit ca4fe47

Browse files
committed
Add clarifying notes to _process_on_off_device_c_heating_state()
1 parent 3801070 commit ca4fe47

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

plugwise/helper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,12 +801,16 @@ def _process_on_off_device_c_heating_state(self, data: GwEntityData) -> None:
801801
data["binary_sensors"]["heating_state"] = data["c_heating_state"]
802802

803803
if self.smile(ADAM):
804+
# First count when not present, then create and init to False.
805+
# When present init to False
804806
if "heating_state" not in data["binary_sensors"]:
805807
self._count += 1
806808
data["binary_sensors"]["heating_state"] = False
809+
807810
if "cooling_state" not in data["binary_sensors"]:
808811
self._count += 1
809812
data["binary_sensors"]["cooling_state"] = False
813+
810814
if self._cooling_enabled:
811815
data["binary_sensors"]["cooling_state"] = data["c_heating_state"]
812816
else:

0 commit comments

Comments
 (0)