1
mirror of https://github.com/home-assistant/core synced 2024-08-02 23:40:32 +02:00

UniFi lies about the client being noted, using the real note instead if it exists (#53542)

This commit is contained in:
Robert Svensson 2021-07-27 12:35:16 +02:00 committed by GitHub
parent 348d7a5622
commit 93899e981f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,7 @@ CLIENT_CONNECTED_ATTRIBUTES = [
"ip",
"is_11r",
"is_guest",
"noted",
"note",
"qos_policy_applied",
"radio",
"radio_proto",
@ -258,13 +258,11 @@ class UniFiClientTracker(UniFiClient, ScannerEntity):
"""Return the client state attributes."""
raw = self.client.raw
attributes_to_check = CLIENT_STATIC_ATTRIBUTES
if self.is_connected:
attributes = {
k: raw[k] for k in CLIENT_CONNECTED_ALL_ATTRIBUTES if k in raw
}
else:
attributes = {k: raw[k] for k in CLIENT_STATIC_ATTRIBUTES if k in raw}
attributes_to_check = CLIENT_CONNECTED_ALL_ATTRIBUTES
attributes = {k: raw[k] for k in attributes_to_check if k in raw}
attributes["is_wired"] = self.is_wired
return attributes