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 Bram Kragten
parent 5ef45fd12e
commit d501bb8d52

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"