From 944f94997ba398dab818971d65859cf97937ff1c Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 27 Oct 2024 12:21:19 +0100 Subject: [PATCH] fix lint/codacy warnings --- src/roomcontrol.cpp | 4 ++-- src/web/WebSchedulerService.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/roomcontrol.cpp b/src/roomcontrol.cpp index 890ee7ee3..439870ae2 100644 --- a/src/roomcontrol.cpp +++ b/src/roomcontrol.cpp @@ -166,9 +166,9 @@ void Roomctrl::check(uint8_t addr, const uint8_t * data, const uint8_t length) { // empty message back if temperature not set or unknown message type if (data[2] == EMSdevice::EMS_TYPE_VERSION) { version(addr, data[0], hc); - } else if (length == 6 && remotetemp_[hc] == EMS_VALUE_INT16_NOTSET) { + } else if (length == 6) { unknown(addr, data[0], data[2], data[3]); - } else if (length == 8 && remotetemp_[hc] == EMS_VALUE_INT16_NOTSET) { + } else if (length == 8) { unknown(addr, data[0], data[3], data[5], data[6]); } else if (data[2] == 0xAF && data[3] == 0) { temperature(addr, data[0], hc); diff --git a/src/web/WebSchedulerService.cpp b/src/web/WebSchedulerService.cpp index 525367b18..3f8adf8a7 100644 --- a/src/web/WebSchedulerService.cpp +++ b/src/web/WebSchedulerService.cpp @@ -322,8 +322,7 @@ bool WebSchedulerService::command(const char * name, const std::string & command JsonDocument doc; if (deserializeJson(doc, cmd) == DeserializationError::Ok) { HTTPClient http; - int httpResult = 0; - std::string url = doc["url"] | ""; + std::string url = doc["url"] | ""; // for a GET with parameters replace commands with values // don't search the complete url, it may contain a devicename in path auto q = url.find_first_of('?'); @@ -342,6 +341,7 @@ bool WebSchedulerService::command(const char * name, const std::string & command std::string method = doc["method"] | "GET"; // default GET // if there is data, force a POST + int httpResult = 0; if (value.length() || method == "post") { // we have all lowercase if (value.find_first_of('{') != std::string::npos) { http.addHeader("Content-Type", "application/json"); // auto-set to JSON