Fix Velux setup (#110886)

fix async_setup without configuration.yaml entry
This commit is contained in:
Paul Daumlechner 2024-02-18 20:39:02 +01:00 committed by GitHub
parent fdd45189ca
commit b358a03379
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,11 +29,14 @@ CONFIG_SCHEMA = vol.Schema(
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the velux component.""" """Set up the velux component."""
if DOMAIN not in config:
return True
hass.async_create_task( hass.async_create_task(
hass.config_entries.flow.async_init( hass.config_entries.flow.async_init(
DOMAIN, DOMAIN,
context={"source": SOURCE_IMPORT}, context={"source": SOURCE_IMPORT},
data=config, data=config[DOMAIN],
) )
) )