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 @@ -884,19 +884,17 @@ def _rank_thermostat(
884884 return None
885885
886886 # Pre-elect new primary
887- if (
888- thermo_matching [appl_class ] == location ["primary_prio" ]
889- and entity_id not in location ["primary" ]
890- ):
891- location ["primary" ].append (entity_id )
887+ if thermo_matching [appl_class ] == location ["primary_prio" ]:
888+ if entity_id not in location ["primary" ]:
889+ location ["primary" ].append (entity_id )
892890 elif (thermo_rank := thermo_matching [appl_class ]) > location ["primary_prio" ]:
893891 location ["primary_prio" ] = thermo_rank
894892 # Demote former primary
895893 if tl_primary := location ["primary" ]:
896894 for item in tl_primary :
897895 if item not in location ["secondary" ]:
898896 location ["secondary" ].append (item )
899- location ["primary" ] = []
897+ location ["primary" ]. remove ( item )
900898 # Crown primary
901899 if entity_id not in location ["primary" ]:
902900 location ["primary" ].append (entity_id )
You can’t perform that action at this time.
0 commit comments