Fix UniFi client tracker host_name missing (#91188)
This commit is contained in:
parent
62bc8df964
commit
0d7711f787
2 changed files with 4 additions and 2 deletions
|
@ -54,7 +54,6 @@ CLIENT_CONNECTED_ATTRIBUTES = [
|
|||
]
|
||||
|
||||
CLIENT_STATIC_ATTRIBUTES = [
|
||||
"hostname",
|
||||
"mac",
|
||||
"name",
|
||||
"oui",
|
||||
|
@ -175,7 +174,7 @@ ENTITY_DESCRIPTIONS: tuple[UnifiTrackerEntityDescription, ...] = (
|
|||
supported_fn=lambda controller, obj_id: True,
|
||||
unique_id_fn=lambda controller, obj_id: f"{obj_id}-{controller.site}",
|
||||
ip_address_fn=lambda api, obj_id: api.clients[obj_id].ip,
|
||||
hostname_fn=lambda api, obj_id: None,
|
||||
hostname_fn=lambda api, obj_id: api.clients[obj_id].hostname,
|
||||
),
|
||||
UnifiTrackerEntityDescription[Devices, Device](
|
||||
key="Device scanner",
|
||||
|
|
|
@ -144,6 +144,9 @@ async def test_tracked_clients(
|
|||
assert len(hass.states.async_entity_ids(TRACKER_DOMAIN)) == 4
|
||||
assert hass.states.get("device_tracker.client_1").state == STATE_NOT_HOME
|
||||
assert hass.states.get("device_tracker.client_2").state == STATE_NOT_HOME
|
||||
assert (
|
||||
hass.states.get("device_tracker.client_5").attributes["host_name"] == "client_5"
|
||||
)
|
||||
|
||||
# Client on SSID not in SSID filter
|
||||
assert not hass.states.get("device_tracker.client_3")
|
||||
|
|
Loading…
Add table
Reference in a new issue