mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
remove command txMode, fix writeable camelCase names
This commit is contained in:
@@ -540,7 +540,6 @@ bool Command::list(const uint8_t device_type, JsonObject output) {
|
|||||||
output["settings/showertimer"] = Helpers::translated_word(FL_(system_cmd));
|
output["settings/showertimer"] = Helpers::translated_word(FL_(system_cmd));
|
||||||
output["settings/showeralert"] = Helpers::translated_word(FL_(system_cmd));
|
output["settings/showeralert"] = Helpers::translated_word(FL_(system_cmd));
|
||||||
output["settings/hideled"] = Helpers::translated_word(FL_(system_cmd));
|
output["settings/hideled"] = Helpers::translated_word(FL_(system_cmd));
|
||||||
output["settings/txmode"] = Helpers::translated_word(FL_(system_cmd));
|
|
||||||
output["settings/analogenabled"] = Helpers::translated_word(FL_(system_cmd));
|
output["settings/analogenabled"] = Helpers::translated_word(FL_(system_cmd));
|
||||||
output["mqtt/enabled"] = Helpers::translated_word(FL_(system_cmd));
|
output["mqtt/enabled"] = Helpers::translated_word(FL_(system_cmd));
|
||||||
output["ntp/enabled"] = Helpers::translated_word(FL_(system_cmd));
|
output["ntp/enabled"] = Helpers::translated_word(FL_(system_cmd));
|
||||||
@@ -579,7 +578,6 @@ void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbo
|
|||||||
sorted_cmds.emplace_back("settings/showertimer");
|
sorted_cmds.emplace_back("settings/showertimer");
|
||||||
sorted_cmds.emplace_back("settings/showeralert");
|
sorted_cmds.emplace_back("settings/showeralert");
|
||||||
sorted_cmds.emplace_back("settings/hideled");
|
sorted_cmds.emplace_back("settings/hideled");
|
||||||
sorted_cmds.emplace_back("settings/txmode");
|
|
||||||
sorted_cmds.emplace_back("settings/analogenabled");
|
sorted_cmds.emplace_back("settings/analogenabled");
|
||||||
sorted_cmds.emplace_back("mqtt/enabled");
|
sorted_cmds.emplace_back("mqtt/enabled");
|
||||||
sorted_cmds.emplace_back("ntp/enabled");
|
sorted_cmds.emplace_back("ntp/enabled");
|
||||||
|
|||||||
@@ -1414,17 +1414,6 @@ bool System::command_service(const char * cmd, const char * value) {
|
|||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int n;
|
|
||||||
if (!ok && Helpers::value2number(value, n)) {
|
|
||||||
if (!strcmp(cmd, "settings/txmode") && n >= 0 && n <= 4) {
|
|
||||||
EMSESP::webSettingsService.update([&](WebSettings & settings) {
|
|
||||||
settings.tx_mode = n;
|
|
||||||
return StateUpdateResult::CHANGED;
|
|
||||||
});
|
|
||||||
EMSESP::uart_init();
|
|
||||||
ok = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
LOG_INFO("System command '%s' with value '%s'", cmd, value);
|
LOG_INFO("System command '%s' with value '%s'", cmd, value);
|
||||||
@@ -1514,7 +1503,7 @@ void System::get_value_json(JsonObject output, const std::string & circuit, cons
|
|||||||
}
|
}
|
||||||
output["readable"] = true;
|
output["readable"] = true;
|
||||||
output["writeable"] =
|
output["writeable"] =
|
||||||
(name == "txmode" || name == "showertimer" || name == "showeralert" || name == "enabled" || name == "hideled" || name == "analogenabled");
|
(name == "showerTimer" || name == "showerAlert" || name == "enabled" || name == "hideLed" || name == "analogEnabled");
|
||||||
output["visible"] = true;
|
output["visible"] = true;
|
||||||
if (val.is<bool>()) {
|
if (val.is<bool>()) {
|
||||||
output["value"] = val.as<bool>();
|
output["value"] = val.as<bool>();
|
||||||
|
|||||||
Reference in New Issue
Block a user