Skip to content

Commit

Permalink
set/getValue bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ewowi committed Jan 24, 2024
1 parent 9ef0c67 commit dedb982
Show file tree
Hide file tree
Showing 2 changed files with 212 additions and 129 deletions.
9 changes: 5 additions & 4 deletions src/Sys/SysModModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ class SysModModel:public SysModule {
JsonObject setValue(const char * id, Type value, uint8_t rowNr = UINT8_MAX) {
JsonObject var = findVar(id);
if (!var.isNull()) {
setValue(var, value, rowNr);
return setValue(var, value, rowNr);
}
else {
USER_PRINTF("setValue Var %s not found\n", id);
return JsonObject();
}
return var;
}

template <typename Type>
Expand Down Expand Up @@ -174,10 +174,10 @@ class SysModModel:public SysModule {
JsonVariant getValue(const char * id, uint8_t rowNr = UINT8_MAX) {
JsonObject var = findVar(id);
if (!var.isNull()) {
getValue(var, rowNr);
return getValue(var, rowNr);
}
else {
// USER_PRINTF("getValue: Var %s does not exist!!\n", id);
USER_PRINTF("getValue: Var %s does not exist!!\n", id);
return JsonVariant();
}
}
Expand All @@ -188,6 +188,7 @@ class SysModModel:public SysModule {
return valueArray[rowNr];
else {
USER_PRINTF("perror getValue no array or rownr wrong %s %d\n", var["value"].as<String>().c_str(), rowNr);
return JsonVariant();
}
}
else
Expand Down
Loading

0 comments on commit dedb982

Please sign in to comment.