@@ -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
@@ -796,8 +798,6 @@ def _scan_thermostats(self) -> None:
796798 the result to update the device_class of secondary thermostats.
797799 """
798800 self ._match_and_rank_thermostats ()
799- # for location_id in self._new_locations:
800- # location = self._loc_data[location_id]
801801 for location_id , location in self ._loc_data .items ():
802802 if location ["primary_prio" ] != 0 :
803803 self ._new_zones .append (location_id )
@@ -835,10 +835,7 @@ def _match_and_rank_thermostats(self) -> dict[str, ThermoLoc]:
835835 "zone_thermostat" : 2 ,
836836 "thermostatic_radiator_valve" : 1 ,
837837 }
838- # for location_id in self._new_locations:
839- # location = self._loc_data[location_id]
840838 for location_id , location in self ._loc_data .items ():
841- location .update ({"primary" : [], "primary_prio" : 0 , "secondary" : []})
842839 for entity_id , entity in self .gw_entities .items ():
843840 self ._rank_thermostat (
844841 entity_id , entity , location_id , location , thermo_matching
0 commit comments