mirror of
https://github.com/home-assistant/core.git
synced 2025-08-02 20:25:07 +02:00
Fix tplink unloading when no switches are present (#50301)
This commit is contained in:
@@ -111,7 +111,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigType):
|
||||
|
||||
async def async_unload_entry(hass, entry):
|
||||
"""Unload a config entry."""
|
||||
platforms = [platform for platform in PLATFORMS if platform in hass.data[DOMAIN]]
|
||||
platforms = [platform for platform in PLATFORMS if hass.data[DOMAIN].get(platform)]
|
||||
unload_ok = await hass.config_entries.async_unload_platforms(entry, platforms)
|
||||
if unload_ok:
|
||||
hass.data[DOMAIN].clear()
|
||||
|
Reference in New Issue
Block a user