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

[items] Fix Item semantics location & equipment #261

Merged
merged 2 commits into from
Apr 25, 2023

Conversation

florian-h05
Copy link
Contributor

Reported in the community, see https://community.openhab.org/t/itemsemantics/146294.

Fixes an issue where the location and equipment properties were not available because getItem failed.
This happened because items.js was imported from item-semantics.js and items.js imported item-semantics.js, which lead to a circular require and failed.
This hacky fix passes the getItem method via the ItemSemantics constructor.

/cc @rkoshak

Reported in the community, see https://community.openhab.org/t/itemsemantics/146294.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 added the bug Something isn't working label Apr 24, 2023
@florian-h05 florian-h05 added this to the to be released milestone Apr 24, 2023
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 requested a review from digitaldan April 24, 2023 20:03
@digitaldan
Copy link
Contributor

This hacky fix passes the getItem method via the ItemSemantics constructor.

Yeah, a little hacky ;-) but i get the alternative might be a larger refactoring, maybe keep a refactor it in mind if this comes up again ? I think its ok for now.

Copy link
Contributor

@digitaldan digitaldan left a comment

Choose a reason for hiding this comment

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

LGTM

@florian-h05
Copy link
Contributor Author

maybe keep a refactor it in mind if this comes up again ? I think its ok for now.

Yeah, if this comes up once again I'd refactor it into the items file, this is the only other solution.

@florian-h05 florian-h05 merged commit bdec19c into openhab:main Apr 25, 2023
@florian-h05 florian-h05 deleted the fix-item-semantics branch April 25, 2023 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants