only emit state changes if the states actually change for real

This commit is contained in:
Michael Zanetti 2014-06-19 22:35:55 +02:00
parent a6725ec4e9
commit 70b6cffda7

View File

@ -160,6 +160,9 @@ void Device::setStateValue(const StateTypeId &stateTypeId, const QVariant &value
{
for (int i = 0; i < m_states.count(); ++i) {
if (m_states.at(i).stateTypeId() == stateTypeId) {
if (m_states.at(i).value() == value) {
return;
}
State newState(stateTypeId, m_id);
newState.setValue(value);
m_states[i] = newState;