Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 14:14 Go to next message
Mark Hilbush is currently offline Mark HilbushFriend
Messages: 4
Registered: November 2018
Junior Member
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 17:11]

Report message to a moderator

Re: Using config to enable/disable background discovery [message #1800450 is a reply to message #1800269] Fri, 28 December 2018 16:57 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
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 17:08 Go to previous messageGo to next message
Mark Hilbush is currently offline Mark HilbushFriend
Messages: 4
Registered: November 2018
Junior Member
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 19:02 Go to previous message
Markus Rathgeb is currently offline Markus RathgebFriend
Messages: 105
Registered: August 2014
Senior Member

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: Fri Apr 19 05:37:04 GMT 2024

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

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

Back to the top