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

Item.sendCommandIfDifferent should handle conversion from JS Number to QuantityType #330

Closed
wertzui opened this issue May 1, 2024 · 0 comments · Fixed by #343
Closed
Labels
enhancement New feature or request

Comments

@wertzui
Copy link

wertzui commented May 1, 2024

Item.sendCommandIfDifferent(value) is an easy way to only send updates if something changed.

However if the items state is a QuantityType and the value is a Number or a String without a quantity, this method always detects a change.
This is, because it compares the strings directly and if for example the state returns 26 °C and the value is 26, these are different.

It would be good if this method handles such cases and if value is a number, it just compares the number of the state and not the value too.

@wertzui wertzui added the enhancement New feature or request label May 1, 2024
florian-h05 added a commit to florian-h05/openhab-js that referenced this issue Jun 16, 2024
Fixes openhab#330.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
florian-h05 added a commit that referenced this issue Jun 16, 2024
)

Fixes #330.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant