Do not call async_delete_issue() if there is no issue to delete in Shelly integration (#120762)

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
This commit is contained in:
Maciej Bieniek 2024-06-28 18:34:24 +02:00 committed by GitHub
parent f4224a0327
commit c029c534d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -377,12 +377,13 @@ class ShellyBlockCoordinator(ShellyCoordinatorBase[BlockDevice]):
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: