Skip to content

Commit

Permalink
cleanup, adapt comments, packages
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Sep 20, 2023
1 parent 5c484d5 commit dcdd8d9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions interface/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -6056,17 +6056,17 @@ __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
commander: ^2.20.0
source-map-support: ~0.5.20
bin:
terser: bin/terser
checksum: 39c6687609f5b9061f2fb82bee02d2f9d7756fcb5bd50c67da1482f52cf5977e03e0c5df5cb4ce17e549428024c8859075137c461ec4a9ae8cf91a505759255a
checksum: ab70d1009fc9d39b89b3fbe5be12d55ade4574df0978de53e046ce109f45d5623fcbbddcb70453e1d95d4967338dab9e41bcff94c1ec636a27c52ef7f6db3936
languageName: node
linkType: hard

Expand Down
4 changes: 1 addition & 3 deletions src/analogsensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 1 addition & 3 deletions src/temperaturesensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/web/WebCustomEntityService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
1 change: 0 additions & 1 deletion src/web/WebSchedulerService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit dcdd8d9

Please sign in to comment.