Skip to content

Commit 7ffd7da

Browse files
committed
Clean up non-thermostat locations
1 parent f0410a0 commit 7ffd7da

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugwise/helper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,10 @@ def _scan_thermostats(self) -> None:
812812
for dev_id, device in self.gw_devices.items():
813813
self._rank_thermostat(thermo_matching, loc_id, dev_id, device)
814814

815+
for loc_id, loc_data in list(self._thermo_locs.items()):
816+
if loc_data["primary_prio"] == 0:
817+
self._thermo_locs.pop(loc_id)
818+
815819
LOGGER.debug("HOI 2 thermo_locs: %s", self._thermo_locs)
816820
# Update secondary thermostat class where needed
817821
for dev_id, device in self.gw_devices.items():
@@ -868,8 +872,6 @@ def _rank_thermostat(
868872
self._thermo_locs[loc_id]["primary"].add(appliance_id)
869873
else:
870874
self._thermo_locs[loc_id]["secondary"].add(appliance_id)
871-
else:
872-
self._thermo_locs.pop(loc_id)
873875

874876
def _control_state(self, loc_id: str) -> str | bool:
875877
"""Helper-function for _device_data_adam().

0 commit comments

Comments
 (0)