Skip to content

Commit 12b7bfe

Browse files
committed
Adapt _control_state()
1 parent 3c0e5a6 commit 12b7bfe

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugwise/helper.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,9 +797,10 @@ def _control_state(self, data: GwEntityData, loc_id: str) -> str | bool:
797797
Represents the heating/cooling demand-state of the local primary thermostat.
798798
Note: heating or cooling can still be active when the setpoint has been reached.
799799
"""
800-
locator = f'location[@id="{loc_id}"]/actuator_functionalities/thermostat_functionality[type="thermostat"]/control_state'
801-
if (ctrl_state := self._domain_objects.find(locator)) is not None:
802-
return str(ctrl_state.text)
800+
801+
if (ctrl_state := data["thermostat"]["control_state"]) is not None:
802+
data["thermostat"].pop("control_state")
803+
return ctrl_state
803804

804805
# Handle missing control_state in regulation_mode off for firmware >= 3.2.0 (issue #776)
805806
# In newer firmware versions, default to "off" when control_state is not present

0 commit comments

Comments
 (0)