Skip to content

Commit 1ff847e

Browse files
committed
Legacy: change to _home_loc_id
1 parent 90527ed commit 1ff847e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

plugwise/legacy/helper.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(self) -> None:
6666
self._count: int
6767
self._domain_objects: etree
6868
self._heater_id: str
69-
self._home_location: str
69+
self._home_loc_id: str
7070
self._is_thermostat: bool
7171
self._last_modified: dict[str, str] = {}
7272
self._loc_data: dict[str, ThermoLoc]
@@ -115,7 +115,7 @@ def _all_appliances(self) -> None:
115115
):
116116
continue # pragma: no cover
117117

118-
appl.location = self._home_location
118+
appl.location = self._home_loc_id
119119
appl.entity_id = appliance.attrib["id"]
120120
appl.name = appliance.find("name").text
121121
# Extend device_class name when a Circle/Stealth is type heater_central -- Pw-Beta Issue #739
@@ -161,7 +161,7 @@ def _all_locations(self) -> None:
161161

162162
# Legacy Anna without outdoor_temp and Stretches have no locations, create fake location-data
163163
if not (locations := self._locations.findall("./location")):
164-
self._home_location = FAKE_LOC
164+
self._home_loc_id = FAKE_LOC
165165
self._loc_data[FAKE_LOC] = {"name": "Home"}
166166
return
167167

@@ -174,11 +174,11 @@ def _all_locations(self) -> None:
174174
continue
175175

176176
if loc.name == "Home":
177-
self._home_location = loc.loc_id
177+
self._home_loc_id = loc.loc_id
178178
# Replace location-name for P1 legacy, can contain privacy-related info
179179
if self.smile_type == "power":
180180
loc.name = "Home"
181-
self._home_location = loc.loc_id
181+
self._home_loc_id = loc.loc_id
182182

183183
self._loc_data[loc.loc_id] = {"name": loc.name}
184184

@@ -187,15 +187,15 @@ def _create_legacy_gateway(self) -> None:
187187
188188
Use the home_location or FAKE_APPL as entity id.
189189
"""
190-
self.gateway_id = self._home_location
190+
self.gateway_id = self._home_loc_id
191191
if self.smile_type == "power":
192192
self.gateway_id = FAKE_APPL
193193

194194
self.gw_entities[self.gateway_id] = {"dev_class": "gateway"}
195195
self._count += 1
196196
for key, value in {
197197
"firmware": str(self.smile_fw_version),
198-
"location": self._home_location,
198+
"location": self._home_loc_id,
199199
"mac_address": self.smile_mac_address,
200200
"model": self.smile_model,
201201
"name": self.smile_name,
@@ -298,7 +298,7 @@ def _get_measurement_data(self, entity_id: str) -> GwEntityData:
298298
# The outdoor_temperature present in APPLIANCES is a local sensor connected to the active device
299299
if self._is_thermostat and entity_id == self.gateway_id:
300300
outdoor_temperature = self._object_value(
301-
self._home_location, "outdoor_temperature"
301+
self._home_loc_id, "outdoor_temperature"
302302
)
303303
if outdoor_temperature is not None:
304304
data.update({"sensors": {"outdoor_temperature": outdoor_temperature}})

0 commit comments

Comments
 (0)