Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure ESPHome dashboard connection recovers if its down when core starts #96449

Merged
merged 4 commits into from Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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:
bdraco marked this conversation as resolved.
Show resolved Hide resolved
# 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