add sending devices that are not in 0x07, add id to info command

This commit is contained in:
MichaelDvP
2021-02-07 15:39:09 +01:00
parent e583c7b0f7
commit 58067d13a7
3 changed files with 29 additions and 6 deletions

View File

@@ -396,8 +396,13 @@ void EMSESPShell::add_console_commands() {
// no value specified, just the cmd
ok = Command::call(device_type, cmd, nullptr, -1, json);
} else if (arguments.size() == 3) {
// has a value but no id
ok = Command::call(device_type, cmd, arguments.back().c_str(), -1, json);
if (strncmp(cmd, "info", 4) == 0) {
// info has a id but no value
ok = Command::call(device_type, cmd, nullptr, atoi(arguments.back().c_str()), json);
} else {
// has a value but no id
ok = Command::call(device_type, cmd, arguments.back().c_str(), -1, json);
}
} else {
// use value, which could be an id or hc
ok = Command::call(device_type, cmd, arguments[2].c_str(), atoi(arguments[3].c_str()), json);