Skip to content

Commit accb705

Browse files
emontnemeryfrenck
authored andcommitted
Fix ESPHome config entry unload (home-assistant#155830)
1 parent 1793abc commit accb705

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

homeassistant/components/esphome/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ESPHomeConfigEntry) -> b
7575

7676
async def async_unload_entry(hass: HomeAssistant, entry: ESPHomeConfigEntry) -> bool:
7777
"""Unload an esphome config entry."""
78-
entry_data = await cleanup_instance(entry)
79-
return await hass.config_entries.async_unload_platforms(
80-
entry, entry_data.loaded_platforms
78+
unload_ok = await hass.config_entries.async_unload_platforms(
79+
entry, entry.runtime_data.loaded_platforms
8180
)
81+
if unload_ok:
82+
await cleanup_instance(entry)
83+
return unload_ok
8284

8385

8486
async def async_remove_entry(hass: HomeAssistant, entry: ESPHomeConfigEntry) -> None:

0 commit comments

Comments
 (0)