@@ -37,11 +37,11 @@ class SmileLegacyAPI(SmileLegacyData):
3737
3838 def __init__ (
3939 self ,
40- request : Callable [..., Awaitable [Any ]],
4140 _is_thermostat : bool ,
4241 _loc_data : dict [str , ThermoLoc ],
4342 _on_off_device : bool ,
4443 _opentherm_device : bool ,
44+ _request : Callable [..., Awaitable [Any ]],
4545 _stretch_v2 : bool ,
4646 _target_smile : str ,
4747 gw_data : GatewayData ,
@@ -59,11 +59,11 @@ def __init__(
5959 self ._loc_data = _loc_data
6060 self ._on_off_device = _on_off_device
6161 self ._opentherm_device = _opentherm_device
62+ self ._request = _request
6263 self ._stretch_v2 = _stretch_v2
6364 self ._target_smile = _target_smile
6465 self .cooling_present = False
6566 self .gw_data = gw_data
66- self .request = request
6767 self .smile_hostname = smile_hostname
6868 self .smile_hw_version = smile_hw_version
6969 self .smile_mac_address = smile_mac_address
@@ -78,12 +78,12 @@ def __init__(
7878
7979 async def full_xml_update (self ) -> None :
8080 """Perform a first fetch of the Plugwise server XML data."""
81- self ._domain_objects = await self .request (DOMAIN_OBJECTS )
82- self ._locations = await self .request (LOCATIONS )
83- self ._modules = await self .request (MODULES )
81+ self ._domain_objects = await self ._request (DOMAIN_OBJECTS )
82+ self ._locations = await self ._request (LOCATIONS )
83+ self ._modules = await self ._request (MODULES )
8484 # P1 legacy has no appliances
8585 if self .smile_type != "power" :
86- self ._appliances = await self .request (APPLIANCES )
86+ self ._appliances = await self ._request (APPLIANCES )
8787
8888 def get_all_gateway_entities (self ) -> None :
8989 """Collect the Plugwise gateway entities and their data and states from the received raw XML-data.
@@ -123,12 +123,12 @@ async def async_update(self) -> PlugwiseData:
123123 ) from err
124124 else :
125125 try :
126- self ._domain_objects = await self .request (DOMAIN_OBJECTS )
126+ self ._domain_objects = await self ._request (DOMAIN_OBJECTS )
127127 match self ._target_smile :
128128 case "smile_v2" :
129- self ._modules = await self .request (MODULES )
129+ self ._modules = await self ._request (MODULES )
130130 case self ._target_smile if self ._target_smile in REQUIRE_APPLIANCES :
131- self ._appliances = await self .request (APPLIANCES )
131+ self ._appliances = await self ._request (APPLIANCES )
132132
133133 self ._update_gw_entities ()
134134 # Detect failed data-retrieval
@@ -300,6 +300,6 @@ async def call_request(self, uri: str, **kwargs: Any) -> None:
300300 method : str = kwargs ["method" ]
301301 data : str | None = kwargs .get ("data" )
302302 try :
303- await self .request (uri , method = method , data = data )
303+ await self ._request (uri , method = method , data = data )
304304 except ConnectionFailedError as exc :
305305 raise ConnectionFailedError from exc
0 commit comments