mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Ensure ESPHome dashboard connection recovers if its down when core starts (#96449)
This commit is contained in:
parent
709d5241ec
commit
7009683226
@ -93,13 +93,6 @@ class ESPHomeDashboardManager:
|
|||||||
hass, addon_slug, url, async_get_clientsession(hass)
|
hass, addon_slug, url, async_get_clientsession(hass)
|
||||||
)
|
)
|
||||||
await dashboard.async_request_refresh()
|
await dashboard.async_request_refresh()
|
||||||
if not cur_dashboard and not dashboard.last_update_success:
|
|
||||||
# If there was no previous dashboard and the new one is not available,
|
|
||||||
# we skip setup and wait for discovery.
|
|
||||||
_LOGGER.error(
|
|
||||||
"Dashboard unavailable; skipping setup: %s", dashboard.last_exception
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
self._current_dashboard = dashboard
|
self._current_dashboard = dashboard
|
||||||
|
|
||||||
|
@ -58,7 +58,9 @@ async def test_setup_dashboard_fails(
|
|||||||
assert mock_config_entry.state == ConfigEntryState.LOADED
|
assert mock_config_entry.state == ConfigEntryState.LOADED
|
||||||
assert mock_get_devices.call_count == 1
|
assert mock_get_devices.call_count == 1
|
||||||
|
|
||||||
assert dashboard.STORAGE_KEY not in hass_storage
|
# The dashboard addon might recover later so we still
|
||||||
|
# allow it to be set up.
|
||||||
|
assert dashboard.STORAGE_KEY in hass_storage
|
||||||
|
|
||||||
|
|
||||||
async def test_setup_dashboard_fails_when_already_setup(
|
async def test_setup_dashboard_fails_when_already_setup(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user