Skip to content

Commit 4ba6ce1

Browse files
committed
Optimize, clean up
1 parent 6bb2c00 commit 4ba6ce1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

plugwise/helper.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ def _get_locations(self) -> None:
232232
continue
233233

234234
loc.name = location.find("name").text
235-
self._loc_data[loc.loc_id] = {"name": loc.name}
235+
self._loc_data[loc.loc_id] = {
236+
"name": loc.name, "primary": [], "primary_prio": 0, "secondary": []
237+
}
236238
if loc.name != "Home":
237239
continue
238240

@@ -794,8 +796,6 @@ def _scan_thermostats(self) -> None:
794796
the result to update the device_class of secondary thermostats.
795797
"""
796798
self._match_and_rank_thermostats()
797-
# for location_id in self._new_locations:
798-
# location = self._loc_data[location_id]
799799
for location_id, location in self._loc_data.items():
800800
if location["primary_prio"] != 0:
801801
self._new_zones.append(location_id)
@@ -833,10 +833,7 @@ def _match_and_rank_thermostats(self) -> dict[str, ThermoLoc]:
833833
"zone_thermostat": 2,
834834
"thermostatic_radiator_valve": 1,
835835
}
836-
# for location_id in self._new_locations:
837-
# location = self._loc_data[location_id]
838836
for location_id, location in self._loc_data.items():
839-
location.update({"primary": [], "primary_prio": 0, "secondary": []})
840837
for entity_id, entity in self.gw_entities.items():
841838
self._rank_thermostat(
842839
entity_id, entity, location_id, location, thermo_matching

0 commit comments

Comments
 (0)