Fix unloading KNX integration without sensors (#97720)

This commit is contained in:
Matthias Alphart 2023-08-03 23:23:12 +02:00 committed by GitHub
parent bfa394d399
commit fd26739bbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -342,10 +342,13 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
unload_ok = await hass.config_entries.async_unload_platforms( unload_ok = await hass.config_entries.async_unload_platforms(
entry, entry,
[ [
platform Platform.SENSOR, # always unload system entities (telegram counter, etc.)
for platform in SUPPORTED_PLATFORMS *[
if platform in hass.data[DATA_KNX_CONFIG] platform
and platform is not Platform.NOTIFY for platform in SUPPORTED_PLATFORMS
if platform in hass.data[DATA_KNX_CONFIG]
and platform not in (Platform.SENSOR, Platform.NOTIFY)
],
], ],
) )
if unload_ok: if unload_ok: