mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
show error when action command fails
This commit is contained in:
@@ -204,12 +204,14 @@ void WebStatusService::action(AsyncWebServerRequest * request, JsonVariant json)
|
|||||||
Serial.println(COLOR_RESET);
|
Serial.println(COLOR_RESET);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// send response
|
// check for error
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
request->send(400);
|
emsesp::EMSESP::logger().err("Action '%s' failed", action.c_str());
|
||||||
|
request->send(400); // bad request
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// send response
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
}
|
}
|
||||||
@@ -256,7 +258,7 @@ bool WebStatusService::checkUpgrade(JsonObject root, std::string & versions) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// action = allvalues
|
// action = allvalues
|
||||||
// output all the devices and the values
|
// output all the devices and their values, including custom entities, scheduler and sensors
|
||||||
void WebStatusService::allvalues(JsonObject output) {
|
void WebStatusService::allvalues(JsonObject output) {
|
||||||
JsonObject device_output;
|
JsonObject device_output;
|
||||||
auto value = F_(values);
|
auto value = F_(values);
|
||||||
|
|||||||
Reference in New Issue
Block a user