Skip to content

Commit

Permalink
Ensure ESPHome dashboard connection recovers if its down when core st…
Browse files Browse the repository at this point in the history
…arts (#96449)
  • Loading branch information
bdraco authored and balloob committed Jul 13, 2023
1 parent 4f95039 commit 2822d98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 0 additions & 7 deletions homeassistant/components/esphome/dashboard.py
Expand Up @@ -93,13 +93,6 @@ async def async_set_dashboard_info(
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

Expand Down
4 changes: 3 additions & 1 deletion tests/components/esphome/test_dashboard.py
Expand Up @@ -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(
Expand Down

0 comments on commit 2822d98

Please sign in to comment.