Skip to content

Commit ea04c6d

Browse files
Fix double reloading in esphome (home-assistant#155142)
1 parent ce6127d commit ea04c6d

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

homeassistant/components/esphome/config_flow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
ConfigFlow,
3232
ConfigFlowResult,
3333
FlowType,
34-
OptionsFlow,
34+
OptionsFlowWithReload,
3535
)
3636
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT
3737
from homeassistant.core import callback
@@ -918,7 +918,7 @@ def async_get_options_flow(
918918
return OptionsFlowHandler()
919919

920920

921-
class OptionsFlowHandler(OptionsFlow):
921+
class OptionsFlowHandler(OptionsFlowWithReload):
922922
"""Handle a option flow for esphome."""
923923

924924
async def async_step_init(

homeassistant/components/esphome/entry_data.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -442,14 +442,6 @@ async def async_cleanup(self) -> None:
442442
# save delay has passed.
443443
await self.store.async_save(self._pending_storage())
444444

445-
async def async_update_listener(
446-
self, hass: HomeAssistant, entry: ESPHomeConfigEntry
447-
) -> None:
448-
"""Handle options update."""
449-
if self.original_options == entry.options:
450-
return
451-
hass.async_create_task(hass.config_entries.async_reload(entry.entry_id))
452-
453445
@callback
454446
def async_on_disconnect(self) -> None:
455447
"""Call when the entry has been disconnected.

homeassistant/components/esphome/manager.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -983,10 +983,6 @@ async def async_start(self) -> None:
983983

984984
await reconnect_logic.start()
985985

986-
entry.async_on_unload(
987-
entry.add_update_listener(entry_data.async_update_listener)
988-
)
989-
990986

991987
@callback
992988
def _async_setup_device_registry(

0 commit comments

Comments
 (0)