Ensure ESPHome dashboard connection recovers if its down when core starts ()

pull/96455/head^2
J. Nick Koston 2023-07-12 14:37:28 -10:00 committed by GitHub
parent 709d5241ec
commit 7009683226
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions
homeassistant/components/esphome
tests/components/esphome

View File

@ -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

View File

@ -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(