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

Open
wertzui opened this issue May 1, 2024 · 0 comments
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
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

No branches or pull requests

1 participant