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.
Item.sendCommandIfDifferent(value)
is an easy way to only send updates if something changed.However if the items state is a
QuantityType
and thevalue
is aNumber
or aString
without a quantity, this method always detects a change. This is, because it compares the strings directly and if for example the state returns26 °C
and the value is26
, 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.