mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
Vesync unload error when not all platforms used (#134166)
This commit is contained in:
parent
7ab2d2e07a
commit
3a68a0a67f
@ -135,7 +135,18 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
||||
|
||||
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
"""Unload a config entry."""
|
||||
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||
in_use_platforms = []
|
||||
if hass.data[DOMAIN][VS_SWITCHES]:
|
||||
in_use_platforms.append(Platform.SWITCH)
|
||||
if hass.data[DOMAIN][VS_FANS]:
|
||||
in_use_platforms.append(Platform.FAN)
|
||||
if hass.data[DOMAIN][VS_LIGHTS]:
|
||||
in_use_platforms.append(Platform.LIGHT)
|
||||
if hass.data[DOMAIN][VS_SENSORS]:
|
||||
in_use_platforms.append(Platform.SENSOR)
|
||||
unload_ok = await hass.config_entries.async_unload_platforms(
|
||||
entry, in_use_platforms
|
||||
)
|
||||
if unload_ok:
|
||||
hass.data.pop(DOMAIN)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user