Add configuration_url to ESPHome (#58565)

This commit is contained in:
Jesse Hills
2021-10-29 17:04:00 +13:00
committed by Paulus Schoutsen
parent 07c9d77414
commit d36df72701
4 changed files with 8 additions and 4 deletions

View File

@@ -327,9 +327,13 @@ async def _async_setup_device_registry(
sw_version = device_info.esphome_version
if device_info.compilation_time:
sw_version += f" ({device_info.compilation_time})"
device_registry = await dr.async_get_registry(hass)
configuration_url = None
if device_info.webserver_port > 0:
configuration_url = f"http://{entry.data['host']}:{device_info.webserver_port}"
device_registry = dr.async_get(hass)
device_entry = device_registry.async_get_or_create(
config_entry_id=entry.entry_id,
configuration_url=configuration_url,
connections={(dr.CONNECTION_NETWORK_MAC, device_info.mac_address)},
name=device_info.name,
manufacturer="espressif",

View File

@@ -3,7 +3,7 @@
"name": "ESPHome",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/esphome",
"requirements": ["aioesphomeapi==10.1.0"],
"requirements": ["aioesphomeapi==10.2.0"],
"zeroconf": ["_esphomelib._tcp.local."],
"codeowners": ["@OttoWinter", "@jesserockz"],
"after_dependencies": ["zeroconf", "tag"],

View File

@@ -161,7 +161,7 @@ aioeagle==1.1.0
aioemonitor==1.0.5
# homeassistant.components.esphome
aioesphomeapi==10.1.0
aioesphomeapi==10.2.0
# homeassistant.components.flo
aioflo==0.4.1

View File

@@ -109,7 +109,7 @@ aioeagle==1.1.0
aioemonitor==1.0.5
# homeassistant.components.esphome
aioesphomeapi==10.1.0
aioesphomeapi==10.2.0
# homeassistant.components.flo
aioflo==0.4.1