UniFi lies about the client being noted, using the real note instead if it exists (#53542)
This commit is contained in:
parent
348d7a5622
commit
93899e981f
1 changed files with 4 additions and 6 deletions
|
@ -38,7 +38,7 @@ CLIENT_CONNECTED_ATTRIBUTES = [
|
||||||
"ip",
|
"ip",
|
||||||
"is_11r",
|
"is_11r",
|
||||||
"is_guest",
|
"is_guest",
|
||||||
"noted",
|
"note",
|
||||||
"qos_policy_applied",
|
"qos_policy_applied",
|
||||||
"radio",
|
"radio",
|
||||||
"radio_proto",
|
"radio_proto",
|
||||||
|
@ -258,13 +258,11 @@ class UniFiClientTracker(UniFiClient, ScannerEntity):
|
||||||
"""Return the client state attributes."""
|
"""Return the client state attributes."""
|
||||||
raw = self.client.raw
|
raw = self.client.raw
|
||||||
|
|
||||||
|
attributes_to_check = CLIENT_STATIC_ATTRIBUTES
|
||||||
if self.is_connected:
|
if self.is_connected:
|
||||||
attributes = {
|
attributes_to_check = CLIENT_CONNECTED_ALL_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 = {k: raw[k] for k in attributes_to_check if k in raw}
|
||||||
attributes["is_wired"] = self.is_wired
|
attributes["is_wired"] = self.is_wired
|
||||||
|
|
||||||
return attributes
|
return attributes
|
||||||
|
|
Loading…
Add table
Reference in a new issue