Skip to content

Commit 0c4271c

Browse files
committed
Adapt for legacy location too
1 parent 8a4202b commit 0c4271c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

plugwise/legacy/helper.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,15 @@ def _all_locations(self) -> None:
148148
return
149149

150150
for location in locations:
151-
loc.name = location.find("name").text
152151
loc.loc_id = location.attrib["id"]
152+
loc.name = location.find("name").text
153+
loc._type = location.find("type").text
153154
# Filter the valid single location for P1 legacy: services not empty
154155
locator = "./services"
155156
if self.smile.type == "power" and len(location.find(locator)) == 0:
156157
continue
157158

158-
if loc.name == "Home":
159-
self._home_loc_id = loc.loc_id
160-
# Replace location-name for P1 legacy, can contain privacy-related info
161-
if self.smile.type == "power":
162-
loc.name = "Home"
159+
if loc._type == "building":
163160
self._home_loc_id = loc.loc_id
164161

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

0 commit comments

Comments
 (0)