From a4d0fbc5d0421236fdc135bba30d23bb7d29d9d9 Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 20 Sep 2023 12:43:40 +0200 Subject: [PATCH] Avoid calling onchange callback on sync event if property isn't changed --- src/property/Property.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/property/Property.cpp b/src/property/Property.cpp index 326e2558..89bbf073 100644 --- a/src/property/Property.cpp +++ b/src/property/Property.cpp @@ -394,8 +394,10 @@ void onAutoSync(Property & property) { } void onForceCloudSync(Property & property) { - property.fromCloudToLocal(); - property.execCallbackOnChange(); + if (property.isDifferentFromCloud()) { + property.fromCloudToLocal(); + property.execCallbackOnChange(); + } } void onForceDeviceSync(Property & /* property */) {