From a87ff4cf291cc1f3d85c497730a0c64bfcd70b8a Mon Sep 17 00:00:00 2001 From: Vincent Le Bourlot Date: Wed, 27 Apr 2022 20:45:41 +0200 Subject: [PATCH] Fix bug in init preventing some discovery (#22) --- custom_components/vesync/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/vesync/__init__.py b/custom_components/vesync/__init__.py index 46689f1..fa66779 100644 --- a/custom_components/vesync/__init__.py +++ b/custom_components/vesync/__init__.py @@ -62,7 +62,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b for p, vs_p in PLATFORMS.items(): hass.data[DOMAIN][config_entry.entry_id][vs_p] = [] - if device_dict[VS_SWITCHES]: + if device_dict[vs_p]: hass.data[DOMAIN][config_entry.entry_id][vs_p].extend(device_dict[vs_p]) hass.async_create_task(forward_setup(config_entry, p))