mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
make 'call system' commands work again
This commit is contained in:
@@ -81,6 +81,7 @@ bool Command::call(const uint8_t device_type, const char * cmd, const char * val
|
||||
return false;
|
||||
}
|
||||
|
||||
// this is for endpoints that don't have commands, i.e not writable (e.g. boiler/syspress)
|
||||
if (cf == nullptr) {
|
||||
return EMSESP::get_device_value_info(json, cmd_new, id_new, device_type);
|
||||
}
|
||||
@@ -88,9 +89,9 @@ bool Command::call(const uint8_t device_type, const char * cmd, const char * val
|
||||
if (cf->cmdfunction_json_) {
|
||||
return ((cf->cmdfunction_json_)(value, id_new, json));
|
||||
} else {
|
||||
// if (value == nullptr || strlen(value) == 0 || strcmp(value, "?") == 0 || strcmp(value, "*") == 0) {
|
||||
// return EMSESP::get_device_value_info(json, cmd_new, id_new, device_type);
|
||||
// }
|
||||
if ((device_type != EMSdevice::DeviceType::SYSTEM) && (value == nullptr || strlen(value) == 0 || strcmp(value, "?") == 0 || strcmp(value, "*") == 0)) {
|
||||
return EMSESP::get_device_value_info(json, cmd_new, id_new, device_type);
|
||||
}
|
||||
return ((cf->cmdfunction_)(value, id_new));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user