diff --git a/custom_components/lanbon_switch/__init__.py b/custom_components/lanbon_switch/__init__.py index da1ef22..8e7215a 100644 --- a/custom_components/lanbon_switch/__init__.py +++ b/custom_components/lanbon_switch/__init__.py @@ -91,10 +91,10 @@ async def discover_device(msg): # Forward setup only if not already done if not hass.data[DOMAIN]["platform_switch_setup_done"]: - hass.data[DOMAIN]["platform_switch_setup_done"] = True hass.async_create_task( hass.config_entries.async_forward_entry_setup(entry, "switch") ) + hass.data[DOMAIN]["platform_switch_setup_done"] = True # Request device states on startup async def sync_device_states(event):