mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 17:29:50 +03:00
code optimizations based on static analysis checks
This commit is contained in:
@@ -736,6 +736,8 @@ void Boiler::show_values(uuid::console::Shell & shell) {
|
||||
shell.println();
|
||||
return;
|
||||
}
|
||||
|
||||
// ww
|
||||
print_value_json(shell, F("wWSelTemp"), nullptr, F_(wWSelTemp), F_(degrees), json);
|
||||
print_value_json(shell, F("wWSetTemp"), nullptr, F_(wWSetTemp), F_(degrees), json);
|
||||
print_value_json(shell, F("wWDisinfectionTemp"), nullptr, F_(wWDisinfectionTemp), F_(degrees), json);
|
||||
|
||||
@@ -33,7 +33,7 @@ void Connect::device_info_web(JsonArray & root) {
|
||||
|
||||
// display all values into the shell console
|
||||
void Connect::show_values(uuid::console::Shell & shell) {
|
||||
// EMSdevice::show_values(shell); // always call this to show header
|
||||
EMSdevice::show_values(shell); // always call this to show header
|
||||
}
|
||||
|
||||
// publish values via MQTT
|
||||
|
||||
@@ -33,7 +33,7 @@ void Controller::device_info_web(JsonArray & root) {
|
||||
|
||||
// display all values into the shell console
|
||||
void Controller::show_values(uuid::console::Shell & shell) {
|
||||
// EMSdevice::show_values(shell); // always call this to show header
|
||||
EMSdevice::show_values(shell); // always call this to show header
|
||||
}
|
||||
|
||||
// publish values via MQTT
|
||||
|
||||
@@ -33,7 +33,7 @@ void Generic::device_info_web(JsonArray & root) {
|
||||
|
||||
// display all values into the shell console
|
||||
void Generic::show_values(uuid::console::Shell & shell) {
|
||||
// EMSdevice::show_values(shell); // always call this to show header
|
||||
EMSdevice::show_values(shell); // always call this to show header
|
||||
}
|
||||
|
||||
// publish values via MQTT
|
||||
|
||||
@@ -34,8 +34,8 @@ Switch::Switch(uint8_t device_type, uint8_t device_id, uint8_t product_id, const
|
||||
register_telegram_type(0x9B, F("WM10SetMessage"), false, [&](std::shared_ptr<const Telegram> t) { process_WM10SetMessage(t); });
|
||||
}
|
||||
|
||||
// fetch the values into a JSON document for display in the web
|
||||
void Switch::device_info_web(JsonArray & root) {
|
||||
// fetch the values into a JSON document
|
||||
StaticJsonDocument<EMSESP_MAX_JSON_SIZE_SMALL> doc;
|
||||
JsonObject json = doc.to<JsonObject>();
|
||||
if (export_values(json)) {
|
||||
@@ -47,8 +47,6 @@ void Switch::device_info_web(JsonArray & root) {
|
||||
|
||||
// display all values into the shell console
|
||||
void Switch::show_values(uuid::console::Shell & shell) {
|
||||
// EMSdevice::show_values(shell); // always call this to show header
|
||||
// fetch the values into a JSON document
|
||||
StaticJsonDocument<EMSESP_MAX_JSON_SIZE_SMALL> doc;
|
||||
JsonObject json = doc.to<JsonObject>();
|
||||
if (export_values(json)) {
|
||||
@@ -66,6 +64,7 @@ void Switch::publish_values(JsonObject & json, bool force) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
StaticJsonDocument<EMSESP_MAX_JSON_SIZE_SMALL> doc;
|
||||
JsonObject json_data = doc.to<JsonObject>();
|
||||
if (export_values(json_data)) {
|
||||
|
||||
Reference in New Issue
Block a user