diff --git a/homeassistant/components/shelly/coordinator.py b/homeassistant/components/shelly/coordinator.py index 02feef3633b7f7..33ed07c35de206 100644 --- a/homeassistant/components/shelly/coordinator.py +++ b/homeassistant/components/shelly/coordinator.py @@ -377,12 +377,13 @@ def _async_handle_update( eager_start=True, ) elif update_type is BlockUpdateType.COAP_PERIODIC: + if self._push_update_failures >= MAX_PUSH_UPDATE_FAILURES: + ir.async_delete_issue( + self.hass, + DOMAIN, + PUSH_UPDATE_ISSUE_ID.format(unique=self.mac), + ) self._push_update_failures = 0 - ir.async_delete_issue( - self.hass, - DOMAIN, - PUSH_UPDATE_ISSUE_ID.format(unique=self.mac), - ) elif update_type is BlockUpdateType.COAP_REPLY: self._push_update_failures += 1 if self._push_update_failures == MAX_PUSH_UPDATE_FAILURES: