From b051ba8d90d2e183f96017a396311894bb691292 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Sat, 23 Mar 2024 13:20:34 +0700 Subject: [PATCH] fix SmartVariable Callback bug --- ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/SmartVariable.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/SmartVariable.cpp b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/SmartVariable.cpp index 652bd84..e8d8674 100644 --- a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/SmartVariable.cpp +++ b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/SmartVariable.cpp @@ -46,6 +46,11 @@ void SmartVariable::setValue(const char *value) this->saveValue(); if (this->iotEnabled) this->publishValue(); + // Call Callbacks + for (auto const &callback : this->valueChangeCallbacks) + { + callback.second(this->value); + } } char *SmartVariable::getValue()