mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
command executed only for commands without value, fix hcx custom names
This commit is contained in:
@@ -109,7 +109,9 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec
|
||||
|
||||
// some commands may be prefixed with hc. dhw. or hc/ or dhw/ so extract these if they exist
|
||||
// parse_command_string returns the extracted command
|
||||
command_p = parse_command_string(command_p, id_n);
|
||||
if (device_type > EMSdevice::DeviceType::BOILER) {
|
||||
command_p = parse_command_string(command_p, id_n);
|
||||
}
|
||||
if (command_p == nullptr) {
|
||||
// handle dead endpoints like api/system or api/boiler
|
||||
// default to 'info' for SYSTEM, the other devices to 'values' for shortname version
|
||||
@@ -159,7 +161,10 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec
|
||||
strlcpy(device_s, d, device_end - d + 1);
|
||||
data_p = device_end + 1;
|
||||
int8_t id_d = -1;
|
||||
data_p = parse_command_string(data_p, id_d);
|
||||
uint8_t device_type = EMSdevice::device_name_2_device_type(device_p);
|
||||
if (device_type > EMSdevice::DeviceType::BOILER) {
|
||||
data_p = parse_command_string(data_p, id_d);
|
||||
}
|
||||
if (data_p == nullptr) {
|
||||
return CommandRet::INVALID;
|
||||
}
|
||||
@@ -170,7 +175,6 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec
|
||||
strcat(data_s, "/value");
|
||||
}
|
||||
|
||||
uint8_t device_type = EMSdevice::device_name_2_device_type(device_p);
|
||||
if (Command::call(device_type, data_s, "", true, id_d, output) != CommandRet::OK) {
|
||||
return CommandRet::INVALID;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user