Ensure this only applies to persistent connections

This commit is contained in:
SupaFlav committed 2023-08-28 15:33:45 -04:00
1 parent 0cadbb9931
commit 296c9cbfd3
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -115,7 +115,7 @@ class BluettiSwitch(CoordinatorEntity, SwitchEntity):
def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
if not self.coordinator.client.is_connected:
if self.coordinator.persistent_conn and not self.coordinator.client.is_connected:
return
_LOGGER.debug("Updating state of %s", unique_id_loggable(self._attr_unique_id))