Skip to main content



      Home
Home » Archived » Eclipse SmartHome » SOLVED: Using config to enable/disable background discovery
SOLVED: Using config to enable/disable background discovery [message #1800269] Sat, 22 December 2018 09:14 Go to next message
Eclipse UserFriend
When a system is stable and in steady state, and there's no need to discover things, system resources can be saved by disabling discovery services for the bindings one has installed.

I understand how to enable/disable background discovery using the background config parameter and the configurationPid when the Discovery Service is declared using the @Component annotation. Like this with a configurationPid of discovery.nameofbinding

discovery.nameofbinding:background=false

However, what about when the Discovery Service is created, activated, and registered in the Handler Factory, such as how it's done in the Hue binding? Is there a way to enable/disable background discovery using a configuration parameter when the Discovery Service is running using this approach? If not, is there some other way to do it?
https://github.com/eclipse/smarthome/blob/0.10.x/extensions/binding/org.eclipse.smarthome.binding.hue/src/main/java/org/eclipse/smarthome/binding/hue/internal/HueThingHandlerFactory.java#L137

[Updated on: Fri, 28 December 2018 12:11] by Moderator

Re: Using config to enable/disable background discovery [message #1800450 is a reply to message #1800269] Fri, 28 December 2018 11:57 Go to previous messageGo to next message
Eclipse UserFriend
For those there is no common way to enable/disable discovery. The only option is to make it a config parameter of the bridge whether or not it shall provide information about newly discovered devices - see https://github.com/eclipse/smarthome/blob/master/extensions/binding/org.eclipse.smarthome.binding.bluetooth.bluegiga/src/main/java/org/eclipse/smarthome/binding/bluetooth/bluegiga/handler/BlueGigaBridgeHandler.java#L174-L178 for an example.
Re: Using config to enable/disable background discovery [message #1800451 is a reply to message #1800450] Fri, 28 December 2018 12:08 Go to previous messageGo to next message
Eclipse UserFriend
Thanks. I had a feeling that would be the case. I ended up doing exactly what you suggested.
Re: Using config to enable/disable background discovery [message #1800621 is a reply to message #1800451] Thu, 03 January 2019 14:02 Go to previous message
Eclipse UserFriend
An "external" component could be easily deactivated programmatically.
See e.g.



It should be easy to create a simple service that can be configured which other components should be disabled (e.g. org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl or every implementation of ...)
Previous Topic:SOLVED:API Incompatibility still exist | Update of master done
Next Topic:Swipe functionality for Dimmer/volume controls
Goto Forum:
  


Current Time: Wed Mar 19 03:09:34 EDT 2025

Powered by FUDForum. Page generated in 0.03617 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top