3737 ActuatorData ,
3838 ActuatorDataType ,
3939 ActuatorType ,
40- GatewayData ,
4140 GwEntityData ,
4241 SensorType ,
4342 ThermoLoc ,
@@ -78,8 +77,8 @@ def __init__(self) -> None:
7877 self ._domain_objects : etree
7978 self ._endpoint : str
8079 self ._elga : bool
80+ self ._gateway_id : str
8181 self ._gw_allowed_modes : list [str ] = []
82- self ._heater_id : str
8382 self ._home_loc_id : str
8483 self ._home_location : etree
8584 self ._is_thermostat : bool
@@ -110,8 +109,6 @@ def __init__(self) -> None:
110109 self ._cooling_active = False
111110 self ._cooling_enabled = False
112111
113- self .gateway_id : str
114- self .gw_data : GatewayData = {}
115112 self .gw_entities : dict [str , GwEntityData ] = {}
116113 self .smile_fw_version : version .Version | None
117114 self .smile_hw_version : str | None
@@ -203,7 +200,7 @@ def _get_p1_smartmeter_info(self) -> None:
203200 LOGGER .error ("No module data found for SmartMeter" ) # pragma: no cover
204201 return # pragma: no cover
205202 appl .available = None
206- appl .entity_id = self .gateway_id
203+ appl .entity_id = self ._gateway_id
207204 appl .firmware = module_data ["firmware_version" ]
208205 appl .hardware = module_data ["hardware_version" ]
209206 appl .location = self ._home_loc_id
@@ -216,8 +213,8 @@ def _get_p1_smartmeter_info(self) -> None:
216213 appl .zigbee_mac = None
217214
218215 # Replace the entity_id of the gateway by the smartmeter location_id
219- self .gw_entities [self ._home_loc_id ] = self .gw_entities .pop (self .gateway_id )
220- self .gateway_id = self ._home_loc_id
216+ self .gw_entities [self ._home_loc_id ] = self .gw_entities .pop (self ._gateway_id )
217+ self ._gateway_id = self ._home_loc_id
221218
222219 self ._create_gw_entities (appl )
223220
@@ -290,7 +287,7 @@ def _appliance_info_finder(self, appl: Munch, appliance: etree) -> Munch:
290287
291288 def _appl_gateway_info (self , appl : Munch , appliance : etree ) -> Munch :
292289 """Helper-function for _appliance_info_finder()."""
293- self .gateway_id = appliance .attrib ["id" ]
290+ self ._gateway_id = appliance .attrib ["id" ]
294291 appl .firmware = str (self .smile_fw_version )
295292 appl .hardware = self .smile_hw_version
296293 appl .mac = self .smile_mac_address
@@ -568,7 +565,7 @@ def _get_actuator_mode(
568565
569566 Collect the requested gateway mode.
570567 """
571- if not (self .smile (ADAM ) and entity_id == self .gateway_id ):
568+ if not (self .smile (ADAM ) and entity_id == self ._gateway_id ):
572569 return None
573570
574571 if (search := search_actuator_functionalities (appliance , key )) is not None :
@@ -609,7 +606,7 @@ def _get_gateway_mode(
609606
610607 def _get_gateway_outdoor_temp (self , entity_id : str , data : GwEntityData ) -> None :
611608 """Adam & Anna: the Smile outdoor_temperature is present in the Home location."""
612- if self ._is_thermostat and entity_id == self .gateway_id :
609+ if self ._is_thermostat and entity_id == self ._gateway_id :
613610 locator = "./logs/point_log[type='outdoor_temperature']/period/measurement"
614611 if (found := self ._home_location .find (locator )) is not None :
615612 value = format_measure (found .text , NONE )
0 commit comments