Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Tags missing on new Item in 'updated' event on ItemRegistryChangeListener #5803

Closed
pdegeus opened this issue Jun 25, 2018 · 4 comments · Fixed by #5852
Closed

Tags missing on new Item in 'updated' event on ItemRegistryChangeListener #5803

pdegeus opened this issue Jun 25, 2018 · 4 comments · Fixed by #5852

Comments

@pdegeus
Copy link

pdegeus commented Jun 25, 2018

When receiving an update event in an ItemRegistryChangeListener, the tags seem to be missing from the second parameter, the new version of the item.

I'm testing with the APT package, 2.4.0-SNAPSHOT, build #1302 on Ubuntu. The issue exists for a while now, first reported by a user of an add-on I wrote, here: https://community.openhab.org/t/imperihome-binding-2-0.

You'll find an add-on to show the issue using logging here:
https://github.com/pdegeus/openhab2-addons/tree/master/addons/io/org.openhab.io.tagtest
I'm sorry not to provide a unit test or similar.

I'm using .items files. Item example:
Number FanMode "Ventilatie" ["iss:room:Attic", "iss:type:DevMultiSwitch", "iss:mapping:0=0, 1=I, 2=II, 3=III"]

Logging on a 'touch' of the items file:

2018-06-25 22:15:17.298 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'attic.items'
2018-06-25 22:15:17.306 [INFO ] [.openhab.io.tagtest.internal.TagTest] - Item updated: 'FanMode', old tags: [iss:room:Attic, iss:type:DevMultiSwitch, iss:mapping:0=0, 1=I, 2=II, 3=III], new tags: []

May be related to #5670, #5654, #5649

@Alpoy
Copy link

Alpoy commented Jun 28, 2018

Hope someone can fix this soon, this completely breaks the imperihome binding and my whole alarm system functionality ;-)

@htreu
Copy link
Contributor

htreu commented Jun 28, 2018

I can confirm this is a bug. With #5431 the tags are now processed with other item bindings (like channel-binding, etc.) which is done in the GenericItemProvider after the registry is informed about the update.

@kaikreuzer
Copy link
Contributor

Btw, @pdegeus, now that we have #4390 in place, it might be worthwhile to refactor the Imperihome add-on to use the metadata infrastructure instead of custom tags (which is not advised anymore). This would also be a workaround for this bug for you as the registry change listeners should flawlessly work on the MetaDataRegistry 😎 .

@pdegeus
Copy link
Author

pdegeus commented Jun 28, 2018

@kaikreuzer Cool, didn't know that was being worked on. I'll refactor the add-on when I've got some spare time. Probably when the nice weather ends ;)
In the meantime it would be great if somebody could fix this bug.

sjsf pushed a commit to sjsf/smarthome that referenced this issue Jul 4, 2018
fixes eclipse-archived#5803
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
htreu pushed a commit that referenced this issue Jul 6, 2018
* Notify item registry change listeners with tags from metadata

fixes #5803
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants