mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Refactor mqtt entity cleanup on reload (#102375)
This commit is contained in:
parent
5ff6779f5c
commit
1bd0b2d05f
@ -426,9 +426,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
entity.async_remove()
|
||||
for mqtt_platform in mqtt_platforms
|
||||
for entity in mqtt_platform.entities.values()
|
||||
# pylint: disable-next=protected-access
|
||||
if not entity._discovery_data # type: ignore[attr-defined]
|
||||
if mqtt_platform.config_entry
|
||||
if getattr(entity, "_discovery_data", None) is None
|
||||
and mqtt_platform.config_entry
|
||||
and mqtt_platform.domain in RELOADABLE_PLATFORMS
|
||||
]
|
||||
await asyncio.gather(*tasks)
|
||||
|
Loading…
x
Reference in New Issue
Block a user