Skip to content

Commit 5fbb627

Browse files
committed
Improve climate
1 parent f29bc08 commit 5fbb627

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

custom_components/plugwise/climate.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,18 @@ def _add_entities() -> None:
7979
if not coordinator.new_pw_entities:
8080
return
8181

82-
thermostat_zone_present = False
8382
entities: list[PlugwiseClimateEntity] = []
8483
for pw_entity_id in coordinator.new_pw_entities:
8584
pw_entity = coordinator.data.entities[pw_entity_id]
8685
if pw_entity[DEV_CLASS] == "climate":
87-
thermostat_zone_present = True
88-
thermostat = coordinator.data.entities[pw_entity_id]
8986
entities.append(
9087
PlugwiseClimateEntity(
9188
coordinator, pw_entity_id, homekit_enabled
9289
) # pw-beta homekit emulation
9390
)
94-
LOGGER.debug("Add climate %s", thermostat[ATTR_NAME])
91+
LOGGER.debug("Add climate %s", pw_entity[ATTR_NAME])
9592

96-
if not thermostat_zone_present:
93+
if not entities:
9794
for pw_entity_id in coordinator.new_pw_entities:
9895
pw_entity = coordinator.data.entities[pw_entity_id]
9996
if pw_entity[DEV_CLASS] in MASTER_THERMOSTATS:

0 commit comments

Comments
 (0)