mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Reload on Withings options flow update (#100397)
* Reload on Withings options flow update * Remove reload from reauth
This commit is contained in:
parent
157647dc44
commit
c34c4f8f03
@ -150,6 +150,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
entry.async_on_unload(async_call_later(hass, 1, async_call_later_callback))
|
entry.async_on_unload(async_call_later(hass, 1, async_call_later_callback))
|
||||||
|
|
||||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||||
|
entry.async_on_unload(entry.add_update_listener(update_listener))
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -171,6 +172,11 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
async def update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
|
||||||
|
"""Handle options update."""
|
||||||
|
await hass.config_entries.async_reload(entry.entry_id)
|
||||||
|
|
||||||
|
|
||||||
async def async_webhook_handler(
|
async def async_webhook_handler(
|
||||||
hass: HomeAssistant, webhook_id: str, request: Request
|
hass: HomeAssistant, webhook_id: str, request: Request
|
||||||
) -> Response | None:
|
) -> Response | None:
|
||||||
|
@ -83,7 +83,6 @@ class WithingsFlowHandler(
|
|||||||
|
|
||||||
if self.reauth_entry.unique_id == user_id:
|
if self.reauth_entry.unique_id == user_id:
|
||||||
self.hass.config_entries.async_update_entry(self.reauth_entry, data=data)
|
self.hass.config_entries.async_update_entry(self.reauth_entry, data=data)
|
||||||
await self.hass.config_entries.async_reload(self.reauth_entry.entry_id)
|
|
||||||
return self.async_abort(reason="reauth_successful")
|
return self.async_abort(reason="reauth_successful")
|
||||||
|
|
||||||
return self.async_abort(reason="wrong_account")
|
return self.async_abort(reason="wrong_account")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user