Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapted AutoUpdateDelegate to the new ESH auto update infrastructure #390

Merged
merged 3 commits into from
Sep 6, 2018

Conversation

kaikreuzer
Copy link
Member

@kaikreuzer kaikreuzer commented Sep 4, 2018

Related to eclipse-archived/smarthome#5011

While at it, I also changed the DS components to use annotations instead of XMLs.

Signed-off-by: Kai Kreuzer kai@openhab.org

@kaikreuzer
Copy link
Member Author

Note to reviewers: This code will only compile / can only be merged once eclipse-archived/smarthome#5011 is merged and a new ESH stable has been built.

@kaikreuzer
Copy link
Member Author

kaikreuzer commented Sep 5, 2018

FTR, eclipse-archived/smarthome#5011 is merged. I'd do a new ESH Stable once one of @openhab/2-x-add-ons-maintainers approves (but not yet merges!) this PR.
Once the ESH Stable is available, we can then rerun the PR build jobs to see if they succeed.

Copy link
Member

@martinvw martinvw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small comments nothing big

synchronized (itemUpdateVetos) {
itemUpdateVetos.clear();
for (Item item : itemRegistry.getAll()) {
for (org.openhab.core.autoupdate.AutoUpdateBindingProvider provider : providers) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be imported?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, indeed, now that it is removed from ESH :-)

itemUpdateVetos.clear();
for (Item item : itemRegistry.getAll()) {
for (org.openhab.core.autoupdate.AutoUpdateBindingProvider provider : providers) {
Boolean autoUpdate = provider.autoUpdate(item.getName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it really return a Boolean with potential null's?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. A provider returns null if it does not want to do any statement.

synchronized (itemUpdateVetos) {
boolean removed = itemUpdateVetos.remove(itemName);
for (org.openhab.core.autoupdate.AutoUpdateBindingProvider provider : providers) {
Object autoUpdate = provider.autoUpdate(itemName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other places we at least use a Boolean...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true


@Reference(cardinality = ReferenceCardinality.MULTIPLE)
public void addAutoUpdateBindingProvider(org.openhab.core.autoupdate.AutoUpdateBindingProvider provider) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we can import these now, given the one from ESH is not imported anymore.

Signed-off-by: Kai Kreuzer <kai@openhab.org>
@kaikreuzer
Copy link
Member Author

Thanks - I have updated the PR.

@kaikreuzer
Copy link
Member Author

Retriggering PR builds...

@kaikreuzer kaikreuzer closed this Sep 5, 2018
@kaikreuzer kaikreuzer reopened this Sep 5, 2018
Signed-off-by: Kai Kreuzer <kai@openhab.org>
@kaikreuzer
Copy link
Member Author

Nice, DS annotations actually caught a bug in the unset method. Fixed it with 8f3dea0.

@kaikreuzer
Copy link
Member Author

@martinvw All green now, so I think we can merge!

@martinvw martinvw merged commit 47c2e33 into openhab:master Sep 6, 2018
@kaikreuzer kaikreuzer deleted the aud branch September 6, 2018 11:23
wborn pushed a commit to wborn/openhab-core that referenced this pull request Sep 10, 2018
…penhab#390)

* adapted AutoUpdateDelegate to the new ESH auto update infrastructure
Related to eclipse-archived/smarthome#5011

Signed-off-by: Kai Kreuzer <kai@openhab.org>
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab2-mysql-persistence-setup/15829/67

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/vera-mios-bindings-for-beginner/23884/13

@martinvw martinvw added this to the 2.4 milestone Dec 9, 2018
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 11, 2023
…penhab#390)

* adapted AutoUpdateDelegate to the new ESH auto update infrastructure
Related to eclipse-archived/smarthome#5011

Signed-off-by: Kai Kreuzer <kai@openhab.org>
GitOrigin-RevId: 47c2e33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants