2222 OFF ,
2323 RULES ,
2424 GwEntityData ,
25- SmileProps ,
2625 ThermoLoc ,
2726)
2827from plugwise .data import SmileData
@@ -51,7 +50,6 @@ def __init__(
5150 _opentherm_device : bool ,
5251 _request : Callable [..., Awaitable [Any ]],
5352 _schedule_old_states : dict [str , dict [str , str ]],
54- _smile_props : SmileProps ,
5553 smile_hostname : str | None ,
5654 smile_hw_version : str | None ,
5755 smile_mac_address : str | None ,
@@ -72,7 +70,6 @@ def __init__(
7270 self ._opentherm_device = _opentherm_device
7371 self ._request = _request
7472 self ._schedule_old_states = _schedule_old_states
75- self ._smile_props = _smile_props
7673 self .smile_hostname = smile_hostname
7774 self .smile_hw_version = smile_hw_version
7875 self .smile_mac_address = smile_mac_address
@@ -126,8 +123,8 @@ async def async_update(self) -> dict[str, GwEntityData]:
126123 self .get_all_gateway_entities ()
127124 # Set self._cooling_enabled - required for set_temperature(),
128125 # also, check for a failed data-retrieval
129- if " heater_id" in self . _smile_props :
130- heat_cooler = self .gw_entities [self ._smile_props [ " heater_id" ] ]
126+ if self . heater_id != NONE :
127+ heat_cooler = self .gw_entities [self .heater_id ]
131128 if (
132129 "binary_sensors" in heat_cooler
133130 and "cooling_enabled" in heat_cooler ["binary_sensors" ]
@@ -136,7 +133,7 @@ async def async_update(self) -> dict[str, GwEntityData]:
136133 "cooling_enabled"
137134 ]
138135 else : # cover failed data-retrieval for P1
139- _ = self .gw_entities [self ._smile_props [ " gateway_id" ] ]["location" ]
136+ _ = self .gw_entities [self .gateway_id ]["location" ]
140137 except KeyError as err :
141138 raise DataMissingError ("No Plugwise actual data received" ) from err
142139
@@ -278,7 +275,7 @@ async def set_gateway_mode(self, mode: str) -> None:
278275 f"{ valid } "
279276 "</gateway_mode_control_functionality>"
280277 )
281- uri = f"{ APPLIANCES } ;id={ self ._smile_props [ ' gateway_id' ] } /gateway_mode_control"
278+ uri = f"{ APPLIANCES } ;id={ self .gateway_id } /gateway_mode_control"
282279 await self .call_request (uri , method = "put" , data = data )
283280
284281 async def set_regulation_mode (self , mode : str ) -> None :
0 commit comments