Skip to content

Commit 066e30e

Browse files
committed
Add clarifying notes to _process_on_off_device_c_heating_state()
1 parent 5a9e17b commit 066e30e

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
@@ -814,12 +814,16 @@ def _process_on_off_device_c_heating_state(self, data: GwEntityData) -> None:
814814
data["binary_sensors"]["heating_state"] = data["c_heating_state"]
815815

816816
if self.smile(ADAM):
817+
# First count when not present, then create and init to False.
818+
# When present init to False
817819
if "heating_state" not in data["binary_sensors"]:
818820
self._count += 1
819821
data["binary_sensors"]["heating_state"] = False
822+
820823
if "cooling_state" not in data["binary_sensors"]:
821824
self._count += 1
822825
data["binary_sensors"]["cooling_state"] = False
826+
823827
if self._cooling_enabled:
824828
data["binary_sensors"]["cooling_state"] = data["c_heating_state"]
825829
else:

0 commit comments

Comments
 (0)