-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[unifi] Fix online/blocked channels after client is disconnected #11451
Merged
kaikreuzer
merged 1 commit into
openhab:main
from
jlaur:7001-unifi-controller-compatibility-fix
Oct 27, 2021
Merged
[unifi] Fix online/blocked channels after client is disconnected #11451
kaikreuzer
merged 1 commit into
openhab:main
from
jlaur:7001-unifi-controller-compatibility-fix
Oct 27, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes openhab#7001 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
jlaur
changed the title
Fix online/blocked channels.
[unifi] Fix online/blocked channels
Oct 25, 2021
jlaur
changed the title
[unifi] Fix online/blocked channels
[unifi] Fix online channel update after client is disconnected
Oct 25, 2021
jlaur
changed the title
[unifi] Fix online channel update after client is disconnected
[unifi] Fix online/blocked channels after client is disconnected
Oct 25, 2021
kaikreuzer
approved these changes
Oct 27, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
kaikreuzer
added
the
bug
An unexpected problem or unintended behavior of an add-on
label
Oct 27, 2021
dschoepel
pushed a commit
to dschoepel/openhab-addons
that referenced
this pull request
Nov 9, 2021
Fixes openhab#7001 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk> Signed-off-by: Dave J Schoepel <dave@theschoepels.com>
NickWaterton
pushed a commit
to NickWaterton/openhab-addons
that referenced
this pull request
Dec 30, 2021
Fixes openhab#7001 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk> Signed-off-by: Nick Waterton <n.waterton@outlook.com>
nemerdaud
pushed a commit
to nemerdaud/openhab-addons
that referenced
this pull request
Jan 28, 2022
Fixes openhab#7001 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
volkmarnissen
pushed a commit
to volkmarnissen/openhab-addons
that referenced
this pull request
Mar 3, 2022
Fixes openhab#7001 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
marcfischerboschio
pushed a commit
to bosch-io/openhab-addons
that referenced
this pull request
May 5, 2022
Fixes openhab#7001 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #7001
Signed-off-by: Jacob Laursen jacob-github@vindvejr.dk
Fixes a problem with the online channel never being updated to OFF after client disconnects. This was most likely introduced by Uni-Fi Controller 5.12.35. The same problem impacted the blocked channel also in the way that unblocking was not possible.
This pull request replaces #11410 with a better approach. Previous PR would keep clients in the cache after they are no longer connected to the access point. This worked for the online channel, but broke the blocked channel as a blocked client would immediately be disconnected from AP, but kept in client cache. This resulted in blocked status going back to unblocked since this was last known status.
New approach chosen is to keep a map of cid (configured key) -> _id values. When _id is returned by controller for the first time, it's kept in this cache and preferred for subsequent lookups. When client disconnects, it can no longer be found in client cache by either _id nor cid. It can however still be found in insights cache by _id. This fixes the problem as the insights cache doesn't contain IP address since controller version 5.12.35 release in beginning of 2020.
Example
When online (other clients/insights removed):
After going offline: