This repository has been archived by the owner on May 7, 2020. It is now read-only.
make auto-update configurable: support config by channel UID and binding ID #3082
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #595
As I worked on that implementation I identified an unstable test in the upstream code base. A PR has been created and should be merged in front of this one (#3080).
Changes that are not really related to this PR. The cleanups have been done "on the fly":
Changes purely related to this PR:
For performance reasons and an easy to use implementation I prefer to provide a service.
If every binding that wants to disable / force-enable auto-update has to provide a service, we end up with services for configuration and I don't think it will perform.
The interface name has been chosen to identify an configuration interface for the auto update service. So, we can consider to add other configuration functions in the future (if we ever need one) without breaking an API or adding further services etc.
To disable or force enable the auto-update in a specific bundle, you only need a reference to the AutoUpdateConfigurator.
This could easily be injected to the ThingFactory because this one implements already an OSGi service and I think we agree that every binding has one. If there is really a binding without a thing factory, place it at some other location.
If you want to disable the auto-update for he whole binding the only thing to do is to call e.g. in the thing factory activate method:
and to remove the configuration again e.g. on the thing factory deactivate method:
If you want to disable auto-update for a given Channel, you can use e.g. this one: