From f708e0a7393e7b16bbfecabca3fc3fa2877264d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Thu, 4 Jul 2024 19:48:25 +0200 Subject: [PATCH] Fix #561: Unexpected error fetching Tapo resource status data --- custom_components/tapo_control/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/tapo_control/utils.py b/custom_components/tapo_control/utils.py index b1924f5..f4b75b3 100644 --- a/custom_components/tapo_control/utils.py +++ b/custom_components/tapo_control/utils.py @@ -1307,7 +1307,10 @@ async def setupEvents(hass, config_entry): "Webhook enabled: " + str(config_entry.data.get(ENABLE_WEBHOOKS) is True) ) LOGGER.debug("Using Webhooks: " + str(shouldUseWebhooks)) - if not hass.data[DOMAIN][config_entry.entry_id]["events"].started: + if ( + hass.data[DOMAIN][config_entry.entry_id]["events"] is not False + and not hass.data[DOMAIN][config_entry.entry_id]["events"].started + ): LOGGER.debug("Setting up events...") events = hass.data[DOMAIN][config_entry.entry_id]["events"] onvif_capabilities = await hass.data[DOMAIN][config_entry.entry_id][