Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix lint/codacy warnings #2145

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/roomcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/web/WebSchedulerService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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('?');
Expand All @@ -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
Expand Down