mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
rename "name" to "entity" for API key - Refactor MQTT subscriptions and API calls #173
This commit is contained in:
@@ -96,9 +96,9 @@ uint8_t Command::process(const char * path, const bool authenticated, const Json
|
|||||||
snprintf(command, sizeof(command), "%s/%s", p.paths()[1].c_str(), p.paths()[2].c_str());
|
snprintf(command, sizeof(command), "%s/%s", p.paths()[1].c_str(), p.paths()[2].c_str());
|
||||||
command_p = command;
|
command_p = command;
|
||||||
} else {
|
} else {
|
||||||
// take it from the JSON. Support both name and cmd to keep backwards compatibility
|
// take it from the JSON
|
||||||
if (input.containsKey("name")) {
|
if (input.containsKey("entity")) {
|
||||||
command_p = input["name"];
|
command_p = input["entity"];
|
||||||
} else if (input.containsKey("cmd")) {
|
} else if (input.containsKey("cmd")) {
|
||||||
command_p = input["cmd"];
|
command_p = input["cmd"];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user