-
-
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
[hue] Implementing "[discovery.upnp] Devices may apply a grace period" #9985
Conversation
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
.../src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeDiscoveryParticipant.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
.../src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeDiscoveryParticipant.java
Outdated
Show resolved
Hide resolved
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.
Build is green 👍🏼 . Two remarks.
wrt the configurationPid: we are using bunding.hue
for factories and discovery.hue
for discovery services. But in this case the second Pid is used for HueBridgeNupnpDiscovery
. Don't know if it is really used over there or if we can remove it from that class and assing it to the UPnP discovery. That'll be a streamlined solution compared to other bindings.
We might ask @ghys if he has an idea how we can handle configuration settings for discovery services from the UI in the future.
.../src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeDiscoveryParticipant.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.hue/src/main/resources/OH-INF/binding/binding.xml
Outdated
Show resolved
Hide resolved
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
It seems to me that the way I have done it, is the solution to the problem. We could even cite the code from this binding in the respective documentation (.md) file. |
Oops. Actually I did that already! |
@cweitkamp in case you missed it, the point of using the binding.hue config file in this case, (rather than the discovery.hue file), is that the binding.hue config file is read/write editable directly in the UI (whereas discovery.hue requires an external text editor). And IMHO it doesn't matter how many classes in the same binding get config values from the same config file, as the respective name/value pairs won't clash. |
.../src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeDiscoveryParticipant.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeDiscoveryParticipant.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Many thanks @cpmeister |
openhab#9985) * [hue] implement PR openhab#2144 in openhab.core * [hue] add binding configuration parameter; return long Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
.../src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeDiscoveryParticipant.java
Show resolved
Hide resolved
openhab#9985) * [hue] implement PR openhab#2144 in openhab.core * [hue] add binding configuration parameter; return long Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch> Signed-off-by: John Marshall <john.marshall.au@gmail.com>
* [hue] extra null check Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch> Signed-off-by: John Marshall <john.marshall.au@gmail.com>
openhab#9985) * [hue] implement PR openhab#2144 in openhab.core * [hue] add binding configuration parameter; return long Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
* [hue] extra null check Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
openhab#9985) * [hue] implement PR openhab#2144 in openhab.core * [hue] add binding configuration parameter; return long Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
* [hue] extra null check Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
BACKGROUND
The JUPnP library strictly follows the UPnP specification insofar as if a device fails to send its next 'ssdp:alive' notification within its declared 'maxAge' period, it is immediately considered to be gone. The Philips Hue can sometimes be late in sending its 'ssdp:alive' notifications even though it has not really gone offline. This means that the Hue Bridge is repeatedly removed from, and (re)added to, the InBox. There may be up to fifty such removals and (re)addings per day. This leads to confusion in the UI, and repeated logger messages.
SOLUTION PART A - CORE
I have made a Pull Request for a change in discovery.upnp that allows bindings to specify an additional grace period that the core UPnP discovery service shall wait before it removes a Thing from the Inbox. The change in [discovery.upnp] comprises an extension to the UpnpDiscoveryParticipant interface adding a new
default int getRemovalGracePeriodSeconds()
method. The change in [discovery.upnp] is implemented so that any existing binding inherits the default method, and its discovery behaviour is thus not changed.SOLUTION PART B - HUE BINDING
This (HUE) binding overrides the
default int getRemovalGracePeriodSeconds()
method, and this asks for an additional grace period, which the core UPnP discovery processes will now honour.REFERENCE
openhab/openhab-core#2144
Signed-off-by: Andrew Fiddian-Green software@whitebear.ch