Allow switches with persistent_conn and add mutex to guard polling

This commit is contained in:
SupaFlav committed 2023-09-03 23:33:26 -04:00
1 parent d38c30011c
commit c3afdcfe89
3 files changed
+84 -88

No files matched your search

-5
View File
@@ -28,11 +28,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
polling_interval = entry.data.get(CONF_POLLING_INTERVAL, 20)
persistent_conn = entry.data.get(CONF_PERSISTENT_CONN, False)
# Prevent persistant connection and controls at same time
if use_controls is True and persistent_conn is True:
_LOGGER.warning("Enabling controls and persistant connection at the same time is currently not supported. Disabled persistant connection")
persistent_conn = False
if address is None:
return False