Skip to content

Commit 27936c0

Browse files
committed
Improve guarding
1 parent 2bc7697 commit 27936c0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

plugwise/helper.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -973,12 +973,13 @@ def _get_appliance_data(self, d_id: str) -> DeviceData:
973973
if "c_heating_state" in data:
974974
if self._elga or (
975975
self.smile_name in ("Adam", "Smile Anna") and self._on_off_device
976-
):
977-
if data["intended_boiler_temperature"] != 0:
978-
data["heating_state"] = data["c_heating_state"]
979-
# For Adam + OnOff cooling, central_heating_state = True means cooling is active
980-
# For Smile Anna, _cooling_active will be corrected in the next if-construc
981-
if self._cooling_present:
976+
):
977+
data["heating_state"] = data["c_heating_state"]
978+
if "intended_boiler_temperature" in data and data["intended_boiler_temperature"] == 0:
979+
data["heating_state"] = False
980+
# For Adam + OnOff cooling, central_heating_state = True means cooling is active
981+
# For Smile Anna, _cooling_active will be corrected in the next if-construc
982+
if self._cooling_present:
982983
self._cooling_active = True
983984

984985
# Finally, remove c_heating_state from the output

0 commit comments

Comments
 (0)