fix: guard config flow against concurrent duplicate entries and revert out-of-scope init changes

This commit is contained in:
Joshua King
2026-09-13 14:50:35 -04:00
parent 30fc3eb1d3
commit cc24d50a0e
3 changed files with 40 additions and 24 deletions
-2
View File
@@ -19,11 +19,9 @@ async def async_setup(hass: HomeAssistant, config: dict[str, Any]) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up NestQuest from a config entry."""
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.entry_id] = entry
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
hass.data.setdefault(DOMAIN, {}).pop(entry.entry_id, None)
return True