Skip to content

Commit 285c10a

Browse files
committed
Fix mypy errors
1 parent 69d620f commit 285c10a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugwise/helper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ def _rank_thermostat(
918918
else:
919919
thermo_loc["secondary"].append(appliance_id)
920920

921-
def _control_state(self, data: GwEntityData, loc_id: str) -> str:
921+
def _control_state(self, data: GwEntityData, loc_id: str) -> str | bool:
922922
"""Helper-function for _get_adam_data().
923923
924924
Adam: find the thermostat control_state of a location, from DOMAIN_OBJECTS.
@@ -929,7 +929,7 @@ def _control_state(self, data: GwEntityData, loc_id: str) -> str:
929929
if (location := self._domain_objects.find(locator)) is not None:
930930
locator = './actuator_functionalities/thermostat_functionality[type="thermostat"]/control_state'
931931
if (ctrl_state := location.find(locator)) is not None:
932-
return ctrl_state.text
932+
return str(ctrl_state.text)
933933

934934
# control_state not present in regulation_mode off (issue #776)
935935
if self.smile_version is not None:
@@ -943,6 +943,8 @@ def _control_state(self, data: GwEntityData, loc_id: str) -> str:
943943
# No cooling available in older firmware
944944
return "heating" if temperature < setpoint else "off"
945945

946+
return False
947+
946948
def _heating_valves(self) -> int | bool:
947949
"""Helper-function for smile.py: _get_adam_data().
948950

0 commit comments

Comments
 (0)