mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 13:21:53 +01:00
Fix suggestion finder installation (#4209)
* fix finder installation * no install/uninstall if no config object Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
This commit is contained in:
parent
4dfbfb4995
commit
49cfb20fb5
@ -80,7 +80,7 @@ public class AddonSuggestionService implements AutoCloseable {
|
||||
this.configurationAdmin = configurationAdmin;
|
||||
this.localeProvider = localeProvider;
|
||||
|
||||
SUGGESTION_FINDERS.forEach(f -> baseFinderConfig.put(f, true));
|
||||
SUGGESTION_FINDERS.forEach(f -> baseFinderConfig.put(f, false));
|
||||
modified(config);
|
||||
|
||||
// Changes to the configuration are expected to call the {@link modified} method. This works well when running
|
||||
@ -115,13 +115,13 @@ public class AddonSuggestionService implements AutoCloseable {
|
||||
String cfgParam = SUGGESTION_FINDER_CONFIGS.get(finder);
|
||||
if (cfgParam != null) {
|
||||
boolean enabled = (config != null)
|
||||
? ConfigParser.valueAsOrElse(config.get(cfgParam), Boolean.class, cfg)
|
||||
? ConfigParser.valueAsOrElse(config.get(cfgParam), Boolean.class, true)
|
||||
: cfg;
|
||||
if (cfg != enabled) {
|
||||
baseFinderConfig.put(finder, enabled);
|
||||
String type = SUGGESTION_FINDER_TYPES.get(finder);
|
||||
AddonFinderService finderService = addonFinderService;
|
||||
if (type != null && finderService != null) {
|
||||
baseFinderConfig.put(finder, enabled);
|
||||
if (enabled) {
|
||||
finderService.install(type);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user