mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00:00
Fix UniFi client tracker host_name missing (#91188)
This commit is contained in:
parent
62bc8df964
commit
0d7711f787
@ -54,7 +54,6 @@ CLIENT_CONNECTED_ATTRIBUTES = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
CLIENT_STATIC_ATTRIBUTES = [
|
CLIENT_STATIC_ATTRIBUTES = [
|
||||||
"hostname",
|
|
||||||
"mac",
|
"mac",
|
||||||
"name",
|
"name",
|
||||||
"oui",
|
"oui",
|
||||||
@ -175,7 +174,7 @@ ENTITY_DESCRIPTIONS: tuple[UnifiTrackerEntityDescription, ...] = (
|
|||||||
supported_fn=lambda controller, obj_id: True,
|
supported_fn=lambda controller, obj_id: True,
|
||||||
unique_id_fn=lambda controller, obj_id: f"{obj_id}-{controller.site}",
|
unique_id_fn=lambda controller, obj_id: f"{obj_id}-{controller.site}",
|
||||||
ip_address_fn=lambda api, obj_id: api.clients[obj_id].ip,
|
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](
|
UnifiTrackerEntityDescription[Devices, Device](
|
||||||
key="Device scanner",
|
key="Device scanner",
|
||||||
|
@ -144,6 +144,9 @@ async def test_tracked_clients(
|
|||||||
assert len(hass.states.async_entity_ids(TRACKER_DOMAIN)) == 4
|
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_1").state == STATE_NOT_HOME
|
||||||
assert hass.states.get("device_tracker.client_2").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
|
# Client on SSID not in SSID filter
|
||||||
assert not hass.states.get("device_tracker.client_3")
|
assert not hass.states.get("device_tracker.client_3")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user