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

Thing.setX methods are not implemented correctly #270

Closed
rkoshak opened this issue Jun 9, 2023 · 3 comments · Fixed by #274
Closed

Thing.setX methods are not implemented correctly #270

rkoshak opened this issue Jun 9, 2023 · 3 comments · Fixed by #274
Labels
bug Something isn't working

Comments

@rkoshak
Copy link
Contributor

rkoshak commented Jun 9, 2023

Expected Behavior

Calling setLabel() on a Thing should persist across OH reboots. The same goes for all the other set methods.

Current Behavior

Calling setLabel() changes the label but after a reboot the label reverts to the old value. I suspect the same goes for the other set methods.

Possible Solution

After calling setLabel() on the Java Thing Object, pass that updated Object to the ThingRegistry.update() method to update the value in the registry which will save the changes to the JSONDB.

Steps to Reproduce (for Bugs)

things.getThing('MyThingID').setLabel('New Label')
  1. Restart OH.
  2. Look at the Thing page and see the label has been reverted.

Context

See openhab/openhab-core#3648 (comment)

@florian-h05
Copy link
Contributor

Duplicates #269 but this has more detail, so I’ll close #269.

@rkoshak
Copy link
Contributor Author

rkoshak commented Jun 9, 2023

Sorry, I didn't even search to see if one was already created.

florian-h05 added a commit to florian-h05/openhab-js that referenced this issue Jun 20, 2023
@florian-h05
Copy link
Contributor

No problem 👍 It was more a note for myself than for others ;-)

Anyway, I have fixed the problem, the update call to the ThingRegistry was missing.

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 a pull request may close this issue.

2 participants