Skip to content

Commit 9d17b70

Browse files
committed
Fix for pw-beta issue #776
1 parent e4c2b9c commit 9d17b70

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

plugwise/helper.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -917,20 +917,19 @@ def _rank_thermostat(
917917
else:
918918
thermo_loc["secondary"].append(appliance_id)
919919

920-
def _control_state(self, loc_id: str) -> str | bool:
920+
def _control_state(self, loc_id: str) -> str:
921921
"""Helper-function for _get_adam_data().
922922
923923
Adam: find the thermostat control_state of a location, from DOMAIN_OBJECTS.
924924
Represents the heating/cooling demand-state of the local primary thermostat.
925925
Note: heating or cooling can still be active when the setpoint has been reached.
926926
"""
927-
locator = f'location[@id="{loc_id}"]'
928-
if (location := self._domain_objects.find(locator)) is not None:
929-
locator = './actuator_functionalities/thermostat_functionality[type="thermostat"]/control_state'
930-
if (ctrl_state := location.find(locator)) is not None:
931-
return str(ctrl_state.text)
927+
locator = f'location[@id="{loc_id}"]/actuator_functionalities/thermostat_functionality[type="thermostat"]/control_state'
928+
if (ctrl_state := self._domain_objects.find(locator)) is not None:
929+
return str(ctrl_state.text)
932930

933-
return False
931+
# When the key is not found the regulation_mode is set to off (#776)
932+
return OFF
934933

935934
def _heating_valves(self) -> int | bool:
936935
"""Helper-function for smile.py: _get_adam_data().

0 commit comments

Comments
 (0)