mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Add support for device configuration URL to Axis devices (#58176)
This commit is contained in:
parent
038158508c
commit
281adfe3c9
@ -172,6 +172,7 @@ class AxisNetworkDevice:
|
|||||||
device_registry = dr.async_get(self.hass)
|
device_registry = dr.async_get(self.hass)
|
||||||
device_registry.async_get_or_create(
|
device_registry.async_get_or_create(
|
||||||
config_entry_id=self.config_entry.entry_id,
|
config_entry_id=self.config_entry.entry_id,
|
||||||
|
configuration_url=self.api.config.url,
|
||||||
connections={(CONNECTION_NETWORK_MAC, self.unique_id)},
|
connections={(CONNECTION_NETWORK_MAC, self.unique_id)},
|
||||||
identifiers={(AXIS_DOMAIN, self.unique_id)},
|
identifiers={(AXIS_DOMAIN, self.unique_id)},
|
||||||
manufacturer=ATTR_MANUFACTURER,
|
manufacturer=ATTR_MANUFACTURER,
|
||||||
|
@ -26,6 +26,7 @@ from homeassistant.const import (
|
|||||||
STATE_ON,
|
STATE_ON,
|
||||||
STATE_UNAVAILABLE,
|
STATE_UNAVAILABLE,
|
||||||
)
|
)
|
||||||
|
from homeassistant.helpers import device_registry as dr
|
||||||
|
|
||||||
from tests.common import MockConfigEntry, async_fire_mqtt_message
|
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.name == ENTRY_CONFIG[CONF_NAME]
|
||||||
assert device.unique_id == FORMATTED_MAC
|
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):
|
async def test_device_info(hass):
|
||||||
"""Verify other path of device information works."""
|
"""Verify other path of device information works."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user