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(
entry,
[
platform
for platform in SUPPORTED_PLATFORMS
if platform in hass.data[DATA_KNX_CONFIG]
and platform is not Platform.NOTIFY
Platform.SENSOR, # always unload system entities (telegram counter, etc.)
*[
platform
for platform in SUPPORTED_PLATFORMS
if platform in hass.data[DATA_KNX_CONFIG]
and platform not in (Platform.SENSOR, Platform.NOTIFY)
],
],
)
if unload_ok: