Add configuration_url to deCONZ device when entry source is addon (#59598)

This commit is contained in:
Robert Svensson 2021-11-14 11:49:02 +01:00 committed by GitHub
parent c6c8c1293f
commit 2ca874a15c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -152,7 +152,7 @@ class DeconzGateway:
# Gateway service
configuration_url = f"http://{self.host}:{self.config_entry.data[CONF_PORT]}"
if self.config_entry.source == SOURCE_HASSIO:
configuration_url = None
configuration_url = "homeassistant://hassio/ingress/core_deconz"
device_registry.async_get_or_create(
config_entry_id=self.config_entry.entry_id,
configuration_url=configuration_url,

View file

@ -179,7 +179,7 @@ async def test_gateway_setup(hass, aioclient_mock):
assert gateway_entry.entry_type == "service"
async def test_gateway_device_no_configuration_url_when_addon(hass, aioclient_mock):
async def test_gateway_device_configuration_url_when_addon(hass, aioclient_mock):
"""Successful setup."""
with patch(
"homeassistant.config_entries.ConfigEntries.async_forward_entry_setup",
@ -195,7 +195,9 @@ async def test_gateway_device_no_configuration_url_when_addon(hass, aioclient_mo
identifiers={(DECONZ_DOMAIN, gateway.bridgeid)}
)
assert not gateway_entry.configuration_url
assert (
gateway_entry.configuration_url == "homeassistant://hassio/ingress/core_deconz"
)
async def test_gateway_retry(hass):