Skip to content

Commit

Permalink
Improve _sort_gw_entities(), partly following suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
bouwew committed Dec 10, 2024
1 parent fa40c50 commit 5a9e17b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugwise/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ def _sort_gw_entities(self) -> None:
for dev_class in ("heater_central", "gateway"):
for entity_id, entity in dict(self.gw_entities).items():
if entity["dev_class"] == dev_class:
tmp_entity = entity
priority_entity = entity
self.gw_entities.pop(entity_id)
cleared_dict = self.gw_entities
add_to_front = {entity_id: tmp_entity}
self.gw_entities = {**add_to_front, **cleared_dict}
other_entities = self.gw_entities
priority_entities = {entity_id: priority_entity}
self.gw_entities = {**priority_entities, **other_entities}

def _all_locations(self) -> None:
"""Collect all locations."""
Expand Down

0 comments on commit 5a9e17b

Please sign in to comment.