Add support for device configuration URL to UniFi Controller (#58237)
This commit is contained in:
parent
e5255cf21f
commit
9c1bee9c16
3 changed files with 13 additions and 0 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue