Skip to content

Commit 3400aad

Browse files
committed
Optimize as suggested
1 parent 6a41486 commit 3400aad

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

plugwise/helper.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -801,12 +801,7 @@ def _rank_thermostat(
801801
Rank the thermostat based on entity-thermostat-type: primary or secondary.
802802
There can be several primary and secondary thermostats per location.
803803
"""
804-
appl_class = entity["dev_class"]
805-
if (
806-
"location" in entity
807-
and location_id == entity["location"]
808-
and appl_class in thermo_matching
809-
):
804+
if (appl_class := entity["dev_class"]) in thermo_matching:
810805
# Pre-elect new primary
811806
if thermo_matching[appl_class] == location["primary_prio"]:
812807
location["primary"].append(entity_id)

0 commit comments

Comments
 (0)