From 4a4b0d9418ed8c070fa0577e06acd2776bca5e38 Mon Sep 17 00:00:00 2001 From: Maciej Bieniek Date: Tue, 25 Jan 2022 08:27:30 +0100 Subject: [PATCH] Fix Shelly climate entity state (#64756) * Fix For loops in _handle_coordinator_update() * Change logic * Suggested change Co-authored-by: Simone Chemelli * Move log Co-authored-by: Simone Chemelli --- homeassistant/components/shelly/climate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/shelly/climate.py b/homeassistant/components/shelly/climate.py index ffc66215678..9a4eb342f71 100644 --- a/homeassistant/components/shelly/climate.py +++ b/homeassistant/components/shelly/climate.py @@ -315,6 +315,6 @@ class BlockSleepingClimate( if hasattr(block, "targetTemp"): self.block = block - _LOGGER.debug("Entity %s attached to block", self.name) - self.async_write_ha_state() - return + if self.device_block and self.block: + _LOGGER.debug("Entity %s attached to blocks", self.name) + self.async_write_ha_state()