Ensure ESPHome dashboard connection recovers if its down when core starts (#96449)
parent
709d5241ec
commit
7009683226
homeassistant/components/esphome
tests/components/esphome
|
@ -93,13 +93,6 @@ class ESPHomeDashboardManager:
|
|||
hass, addon_slug, url, async_get_clientsession(hass)
|
||||
)
|
||||
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
|
||||
|
||||
|
|
|
@ -58,7 +58,9 @@ async def test_setup_dashboard_fails(
|
|||
assert mock_config_entry.state == ConfigEntryState.LOADED
|
||||
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(
|
||||
|
|
Loading…
Reference in New Issue