Does anyone know if there is a way to have a discovery service configured ? I’m creating a new binding to query my cable provider and discover the “devices”, but I need to specify user/password to query their web service.
Any ideas ?
There is the onActivate method but where would the config be ?
What you need to do is to dynamically register the discovery service instead of an automatic register from the xml file definition when your bridge starts. Then you can construct the discovery however you want and pass the creds along to the service itself from the bridge.
Then when the bridge gets shutdown/deactivated, you unregister the service to the OSGi platform.
There is at least one binding that acts that way already (I don’t recall if it’s in the smarthome or openhab2 addons repo), but if you look for the discovery interface, you will eventually find a dynamic registration in a thing/bridge object.
I can send you the piece of code to do that later today.