reload service: remove entities before disconnection (#58712)

This commit is contained in:
Matthias Alphart
2021-10-30 00:04:57 +02:00
committed by Paulus Schoutsen
parent 8cfdd49f36
commit d7531096ef

View File

@@ -239,15 +239,13 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
# First check for config file. If for some reason it is no longer there
# or knx is no longer mentioned, stop the reload.
config = await async_integration_yaml_config(hass, DOMAIN)
if not config or DOMAIN not in config:
return
await knx_module.xknx.stop()
await asyncio.gather(
*(platform.async_reset() for platform in async_get_platforms(hass, DOMAIN))
)
await knx_module.xknx.stop()
await async_setup(hass, config)