allow number and string for MQTT json commands - #445

This commit is contained in:
proddy
2020-08-15 19:53:55 +02:00
parent 64063fa6cd
commit 67877d07c5
7 changed files with 53 additions and 81 deletions

View File

@@ -186,7 +186,7 @@ char * Helpers::render_value(char * result, const int16_t value, const uint8_t f
return nullptr;
}
// just print it if mo conversion required (format = 0)
// just print it if no conversion required (format = 0)
if (!format) {
itoa(result, value, 10);
return result;
@@ -406,7 +406,7 @@ bool Helpers::value2bool(const char * v, bool & value) {
if ((bool_str == "off") || (bool_str == "0") or (bool_str == "false")) {
value = false;
return true; // is a bool
return true; // is a bool
}
return false; // not a bool