fix SmartVariable Callback bug

This commit is contained in:
Siwat Sirichai 2024-03-23 13:20:34 +07:00
parent dcc9092026
commit b051ba8d90
1 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,11 @@ void SmartVariable::setValue(const char *value)
this->saveValue(); this->saveValue();
if (this->iotEnabled) if (this->iotEnabled)
this->publishValue(); this->publishValue();
// Call Callbacks
for (auto const &callback : this->valueChangeCallbacks)
{
callback.second(this->value);
}
} }
char *SmartVariable::getValue() char *SmartVariable::getValue()