mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
fix wwc ids
This commit is contained in:
@@ -126,6 +126,7 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec
|
|||||||
id_n = input["hc"];
|
id_n = input["hc"];
|
||||||
} else if (input.containsKey("wwc")) {
|
} else if (input.containsKey("wwc")) {
|
||||||
id_n = input["wwc"];
|
id_n = input["wwc"];
|
||||||
|
id_n += 7; // wwc1 has id 8
|
||||||
} else if (input.containsKey("id")) {
|
} else if (input.containsKey("id")) {
|
||||||
id_n = input["id"];
|
id_n = input["id"];
|
||||||
}
|
}
|
||||||
@@ -210,7 +211,7 @@ const char * Command::parse_command_string(const char * command, int8_t & id) {
|
|||||||
if (!strncmp(command, "hc", 2) && start_pos == 4) {
|
if (!strncmp(command, "hc", 2) && start_pos == 4) {
|
||||||
id = command[start_pos - 2] - '0';
|
id = command[start_pos - 2] - '0';
|
||||||
} else if (!strncmp(command, "wwc", 3) && start_pos == 5) {
|
} else if (!strncmp(command, "wwc", 3) && start_pos == 5) {
|
||||||
id = command[start_pos - 2] - '0';
|
id = command[start_pos - 2] - '0' + 7; // wwc1 has id 8
|
||||||
} else {
|
} else {
|
||||||
#if defined(EMSESP_DEBUG)
|
#if defined(EMSESP_DEBUG)
|
||||||
LOG_DEBUG(F("[DEBUG] Command parse error, unknown hc/wwc in %s"), command_s);
|
LOG_DEBUG(F("[DEBUG] Command parse error, unknown hc/wwc in %s"), command_s);
|
||||||
|
|||||||
Reference in New Issue
Block a user