diff --git a/interface/package.json b/interface/package.json index 183b4da1c..bcbaab1ac 100644 --- a/interface/package.json +++ b/interface/package.json @@ -69,7 +69,7 @@ "npm-run-all": "^4.1.5", "prettier": "^3.0.3", "rollup-plugin-visualizer": "^5.9.2", - "terser": "^5.19.4", + "terser": "^5.20.0", "vite": "^4.4.9", "vite-plugin-svgr": "^4.0.0", "vite-tsconfig-paths": "^4.2.1" diff --git a/interface/yarn.lock b/interface/yarn.lock index eb4065130..5e5f656df 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -1869,7 +1869,7 @@ __metadata: react-toastify: ^9.1.3 rollup-plugin-visualizer: ^5.9.2 sockette: ^2.0.6 - terser: ^5.19.4 + terser: ^5.20.0 typesafe-i18n: ^5.26.2 typescript: ^5.2.2 vite: ^4.4.9 @@ -6056,9 +6056,9 @@ __metadata: languageName: node linkType: hard -"terser@npm:^5.19.4": - version: 5.19.4 - resolution: "terser@npm:5.19.4" +"terser@npm:^5.20.0": + version: 5.20.0 + resolution: "terser@npm:5.20.0" dependencies: "@jridgewell/source-map": ^0.3.3 acorn: ^8.8.2 @@ -6066,7 +6066,7 @@ __metadata: source-map-support: ~0.5.20 bin: terser: bin/terser - checksum: 39c6687609f5b9061f2fb82bee02d2f9d7756fcb5bd50c67da1482f52cf5977e03e0c5df5cb4ce17e549428024c8859075137c461ec4a9ae8cf91a505759255a + checksum: ab70d1009fc9d39b89b3fbe5be12d55ade4574df0978de53e046ce109f45d5623fcbbddcb70453e1d95d4967338dab9e41bcff94c1ec636a27c52ef7f6db3936 languageName: node linkType: hard diff --git a/src/analogsensor.cpp b/src/analogsensor.cpp index ac5469908..a819b17cd 100644 --- a/src/analogsensor.cpp +++ b/src/analogsensor.cpp @@ -625,7 +625,6 @@ void AnalogSensor::publish_values(const bool force) { // searches by name bool AnalogSensor::get_value_info(JsonObject & output, const char * cmd, const int8_t id) const { if (sensors_.empty()) { - // output["message"] = "no entries"; return true; } // make a copy of the string command for parsing @@ -684,10 +683,9 @@ bool AnalogSensor::get_value_info(JsonObject & output, const char * cmd, const i } // creates JSON doc from values -// returns false if there are no sensors +// returns true if there are no sensors bool AnalogSensor::command_info(const char * value, const int8_t id, JsonObject & output) const { if (sensors_.empty()) { - // output["message"] = "no entries"; return true; } diff --git a/src/temperaturesensor.cpp b/src/temperaturesensor.cpp index 5149ecb01..ca640945a 100644 --- a/src/temperaturesensor.cpp +++ b/src/temperaturesensor.cpp @@ -360,10 +360,9 @@ bool TemperatureSensor::command_commands(const char * value, const int8_t id, Js } // creates JSON doc from values -// returns false if there are no sensors +// returns true if there are no sensors bool TemperatureSensor::command_info(const char * value, const int8_t id, JsonObject & output) { if (sensors_.empty()) { - // output["message"] = "no entries"; return true; } @@ -390,7 +389,6 @@ bool TemperatureSensor::command_info(const char * value, const int8_t id, JsonOb // called from emsesp.cpp, similar to the emsdevice->get_value_info bool TemperatureSensor::get_value_info(JsonObject & output, const char * cmd, const int8_t id) { if (sensors_.empty()) { - // output["message"] = "no entries"; return true; } // make a copy of the string command for parsing diff --git a/src/web/WebCustomEntityService.cpp b/src/web/WebCustomEntityService.cpp index ac0c21e37..f4c2d9d47 100644 --- a/src/web/WebCustomEntityService.cpp +++ b/src/web/WebCustomEntityService.cpp @@ -247,10 +247,9 @@ bool WebCustomEntityService::get_value_info(JsonObject & output, const char * cm } return true; } - // if no entries, return a message instead of an error + // if no entries, return empty json // https://github.com/emsesp/EMS-ESP32/issues/1297 if (customEntityItems->size() == 0) { - // output["message"] = "no entries"; return true; } if (strlen(cmd) == 0 || Helpers::toLower(cmd) == F_(values) || Helpers::toLower(cmd) == F_(info)) { diff --git a/src/web/WebSchedulerService.cpp b/src/web/WebSchedulerService.cpp index 3209c35d0..a11a71104 100644 --- a/src/web/WebSchedulerService.cpp +++ b/src/web/WebSchedulerService.cpp @@ -144,7 +144,6 @@ bool WebSchedulerService::get_value_info(JsonObject & output, const char * cmd) return true; } if (scheduleItems->size() == 0) { - // output["message"] = "no entries"; return true; } if (strlen(cmd) == 0 || Helpers::toLower(cmd) == F_(values) || Helpers::toLower(cmd) == F_(info)) {