Skip to content

Commit

Permalink
Merge pull request #378 from pennam/onchange-cbk
Browse files Browse the repository at this point in the history
Avoid calling onchange callback on sync event if property isn't changed
  • Loading branch information
pennam authored Nov 23, 2023
2 parents 6a9acc2 + a4d0fbc commit babad89
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/property/Property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,10 @@ void onAutoSync(Property & property) {
}

void onForceCloudSync(Property & property) {
property.fromCloudToLocal();
property.execCallbackOnChange();
if (property.isDifferentFromCloud()) {
property.fromCloudToLocal();
property.execCallbackOnChange();
}
}

void onForceDeviceSync(Property & /* property */) {
Expand Down

0 comments on commit babad89

Please sign in to comment.