mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
minor text changes
This commit is contained in:
@@ -43,7 +43,7 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *
|
|||||||
|
|
||||||
// check if we're allowed to call it
|
// check if we're allowed to call it
|
||||||
if (cf->has_flags(CommandFlag::ADMIN_ONLY) && !authenticated) {
|
if (cf->has_flags(CommandFlag::ADMIN_ONLY) && !authenticated) {
|
||||||
LOG_WARNING(F("Command %s on %s not permitted. requires admin."), cmd, EMSdevice::device_type_2_device_name(device_type).c_str());
|
LOG_WARNING(F("Command %s on %s requires valid authorization"), cmd, EMSdevice::device_type_2_device_name(device_type).c_str());
|
||||||
return CommandRet::NOT_ALLOWED;
|
return CommandRet::NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,8 +71,8 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *
|
|||||||
|
|
||||||
// check if we're allowed to call it
|
// check if we're allowed to call it
|
||||||
if (cf != nullptr) {
|
if (cf != nullptr) {
|
||||||
if (cf->has_flags(CommandFlag::ADMIN_ONLY) && !authenticated && value != nullptr) {
|
if (cf->has_flags(CommandFlag::ADMIN_ONLY) && !authenticated) {
|
||||||
LOG_WARNING(F("Command %s on %s not permitted. requires admin."), cmd, EMSdevice::device_type_2_device_name(device_type).c_str());
|
LOG_WARNING(F("Command %s on %s requires valid authorization"), cmd, EMSdevice::device_type_2_device_name(device_type).c_str());
|
||||||
return CommandRet::NOT_ALLOWED; // command not allowed
|
return CommandRet::NOT_ALLOWED; // command not allowed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *
|
|||||||
} else if (id == -1) {
|
} else if (id == -1) {
|
||||||
LOG_INFO(F("Calling %s command '%s', value %s, id is default"), dname.c_str(), cmd, value);
|
LOG_INFO(F("Calling %s command '%s', value %s, id is default"), dname.c_str(), cmd, value);
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO(F("Calling %s command '%s', value %s, id is %d"), dname.c_str(), cmd, value, id);
|
LOG_INFO(F("Calling %s command '%s', value %s, id is %d"), dname.c_str(), cmd, value, id_new);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if json object is empty, if so quit
|
// check if json object is empty, if so quit
|
||||||
@@ -306,7 +306,7 @@ void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbo
|
|||||||
if (cf.has_flags(CommandFlag::ADMIN_ONLY)) {
|
if (cf.has_flags(CommandFlag::ADMIN_ONLY)) {
|
||||||
shell.print(' ');
|
shell.print(' ');
|
||||||
shell.print(COLOR_BRIGHT_RED);
|
shell.print(COLOR_BRIGHT_RED);
|
||||||
shell.print('*');
|
shell.print('!');
|
||||||
}
|
}
|
||||||
shell.print(COLOR_RESET);
|
shell.print(COLOR_RESET);
|
||||||
}
|
}
|
||||||
@@ -367,7 +367,7 @@ void Command::show_devices(uuid::console::Shell & shell) {
|
|||||||
// output list of all commands to console
|
// output list of all commands to console
|
||||||
// calls show with verbose mode set
|
// calls show with verbose mode set
|
||||||
void Command::show_all(uuid::console::Shell & shell) {
|
void Command::show_all(uuid::console::Shell & shell) {
|
||||||
shell.println(F("Available commands (* = need authorization): "));
|
shell.println(F("Available commands (!=requires authorization): "));
|
||||||
|
|
||||||
// show system first
|
// show system first
|
||||||
shell.print(COLOR_BOLD_ON);
|
shell.print(COLOR_BOLD_ON);
|
||||||
|
|||||||
Reference in New Issue
Block a user