Skip to content

Commit 9e939d8

Browse files
committed
Split init loc_data dict
1 parent 1fcba63 commit 9e939d8

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

plugwise/helper.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,7 @@ def _get_locations(self) -> None:
212212
loc.loc_id = location.get("id")
213213
loc.name = location.find("name").text
214214
loc._type = location.find("type").text
215-
self._loc_data[loc.loc_id] = {
216-
"name": loc.name,
217-
"primary": [],
218-
"primary_prio": 0,
219-
"secondary": [],
220-
}
215+
self._loc_data[loc.loc_id] = {"name": loc.name}
221216
# Home location is of type building
222217
if loc._type == "building":
223218
counter += 1
@@ -777,6 +772,7 @@ def _match_and_rank_thermostats(self) -> None:
777772
Match thermostat-appliances with locations, rank them for locations with multiple thermostats.
778773
"""
779774
for location_id, location in self._loc_data.items():
775+
location.update({"primary": [], "primary_prio": 0, "secondary": []})
780776
for entity_id, entity in self.gw_entities.items():
781777
self._rank_thermostat(
782778
entity_id, entity, location_id, location, THERMO_MATCHING

0 commit comments

Comments
 (0)