File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -139,16 +139,14 @@ def _all_appliances(self) -> None:
139139 self ._reorder_devices ()
140140
141141 def _reorder_devices (self ) -> None :
142- """Place the gateway and optional heater_central devices as 1st and 2nd."""
142+ """Place the gateway and optional heater_central devices as 1st and 2nd."""
143+ reordered = {}
143144 for dev_class in PRIORITY_DEVICE_CLASSES :
144145 for entity_id , entity in dict (self .gw_entities ).items ():
145146 if entity ["dev_class" ] == dev_class :
146- tmp_entity = entity
147- self .gw_entities .pop (entity_id )
148- cleared_dict = self .gw_entities
149- add_to_front = {entity_id : tmp_entity }
150- self .gw_entities = {** add_to_front , ** cleared_dict }
147+ reordered [entity_id ] = self .gw_entities .pop (entity_id )
151148 break
149+ self .gw_entities = {** reordered , ** self .gw_entities }
152150
153151 def _all_locations (self ) -> None :
154152 """Collect all locations."""
You can’t perform that action at this time.
0 commit comments