Add support for device configuration URL to UniFi Controller (#58237)
This commit is contained in:
@@ -40,6 +40,8 @@ from homeassistant.const import (
|
||||
CONF_VERIFY_SSL,
|
||||
CONTENT_TYPE_JSON,
|
||||
)
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.setup import async_setup_component
|
||||
import homeassistant.util.dt as dt_util
|
||||
@@ -256,6 +258,14 @@ async def test_controller_mac(hass, aioclient_mock):
|
||||
controller = hass.data[UNIFI_DOMAIN][config_entry.entry_id]
|
||||
assert controller.mac == CONTROLLER_HOST["mac"]
|
||||
|
||||
device_registry = dr.async_get(hass)
|
||||
device_entry = device_registry.async_get_or_create(
|
||||
config_entry_id=config_entry.entry_id,
|
||||
connections={(CONNECTION_NETWORK_MAC, controller.mac)},
|
||||
)
|
||||
|
||||
assert device_entry.configuration_url == controller.api.url
|
||||
|
||||
|
||||
async def test_controller_not_accessible(hass):
|
||||
"""Retry to login gets scheduled when connection fails."""
|
||||
|
||||
Reference in New Issue
Block a user