Add support for device configuration URL to Axis devices (#58176)

This commit is contained in:
Robert Svensson 2021-10-22 11:09:50 +02:00 committed by GitHub
parent 038158508c
commit 281adfe3c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -172,6 +172,7 @@ class AxisNetworkDevice:
device_registry = dr.async_get(self.hass)
device_registry.async_get_or_create(
config_entry_id=self.config_entry.entry_id,
configuration_url=self.api.config.url,
connections={(CONNECTION_NETWORK_MAC, self.unique_id)},
identifiers={(AXIS_DOMAIN, self.unique_id)},
manufacturer=ATTR_MANUFACTURER,

View File

@ -26,6 +26,7 @@ from homeassistant.const import (
STATE_ON,
STATE_UNAVAILABLE,
)
from homeassistant.helpers import device_registry as dr
from tests.common import MockConfigEntry, async_fire_mqtt_message
@ -323,6 +324,13 @@ async def test_device_setup(hass):
assert device.name == ENTRY_CONFIG[CONF_NAME]
assert device.unique_id == FORMATTED_MAC
device_registry = dr.async_get(hass)
device_entry = device_registry.async_get_device(
identifiers={(AXIS_DOMAIN, device.unique_id)}
)
assert device_entry.configuration_url == device.api.config.url
async def test_device_info(hass):
"""Verify other path of device information works."""