Fix more warnings seen with "--warnings more"

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
Álvaro Fernández Rojas 2023-05-31 18:37:13 +02:00
parent 5b0e19438a
commit a1d4a36379
11 changed files with 59 additions and 45 deletions

View file

@ -250,7 +250,6 @@ void Web::begin() {
server.on("/", []() {
webServer.sendCacheHeaders(604800);
webServer.sendCORSHeaders();
int statusCode = 200;
// Load the index html page from the data directory.
Serial.println("Loading file index.html");
File file = LittleFS.open("/index.html", "r");
@ -481,7 +480,7 @@ void Web::begin() {
});
server.on("/addShade", []() {
HTTPMethod method = server.method();
SomfyShade* shade;
SomfyShade* shade = nullptr;
if (method == HTTP_POST || method == HTTP_PUT) {
Serial.println("Adding a shade");
DynamicJsonDocument doc(512);
@ -1320,7 +1319,6 @@ void Web::begin() {
});
server.on("/setgeneral", []() {
webServer.sendCORSHeaders();
int statusCode = 200;
DynamicJsonDocument doc(256);
DeserializationError err = deserializeJson(doc, server.arg("plain"));
if (err) {
@ -1399,7 +1397,6 @@ void Web::begin() {
});
server.on("/connectwifi", []() {
webServer.sendCORSHeaders();
int statusCode = 200;
Serial.println("Settings WIFI connection...");
DynamicJsonDocument doc(512);
DeserializationError err = deserializeJson(doc, server.arg("plain"));