Only set ESPHome configuration url to addon if there is an existing configuration for the device (#129356)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Jesse Hills 2024-11-04 13:16:49 +13:00 committed by GitHub
parent a05a34239d
commit 87ab2beddf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -570,7 +570,9 @@ def _async_setup_device_registry(
configuration_url = None
if device_info.webserver_port > 0:
configuration_url = f"http://{entry.data['host']}:{device_info.webserver_port}"
elif dashboard := async_get_dashboard(hass):
elif (dashboard := async_get_dashboard(hass)) and dashboard.data.get(
device_info.name
):
configuration_url = f"homeassistant://hassio/ingress/{dashboard.addon_slug}"
manufacturer = "espressif"