Fix filters genering wrong data types

When enabling a jitter filter on integer states (e.g. a signal
strength that repeatedly jumps up and down by 1), old code
may cause integer state to be populated with floating point values
as the filtering happens after the intial validation for the new
value being valid.
pull/517/head
Michael Zanetti 2022-04-13 00:42:55 +02:00
parent 45081ad64e
commit bbc585e92e
1 changed files with 1 additions and 0 deletions

View File

@ -401,6 +401,7 @@ void Thing::setStateValue(const StateTypeId &stateTypeId, const QVariant &value)
if (filter) {
filter->addValue(newValue);
newValue = filter->filteredValue();
newValue.convert(stateType.type());
}
QVariant oldValue = m_states.at(i).value();