Skip to content

Commit

Permalink
Merge pull request #465 from iranl/fix-operators
Browse files Browse the repository at this point in the history
Fix operators
  • Loading branch information
iranl committed Aug 25, 2024
2 parents 8831beb + b2100ce commit d3c3589
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/NukiOpenerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value)
}
}

if(!code == 12)
if(code != 12)
{
String codeStr = json["code"].as<String>();
bool codeValid = code > 100000 && code < 1000000 && (codeStr.indexOf('0') == -1);
Expand Down Expand Up @@ -2086,7 +2086,7 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value)
entry.codeId = codeId;
entry.code = code;

if(!name.length() > 0)
if(name.length() < 1)
{
size_t nameLen = strlen(oldName);
memcpy(&entry.name, oldName, nameLen > 20 ? 20 : nameLen);
Expand Down
6 changes: 3 additions & 3 deletions src/NukiWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
else jsonResult[basicKeys[i]] = "invalidValue";
}

if(!cmdResult == Nuki::CmdResult::Success) {
if(cmdResult != Nuki::CmdResult::Success) {
++_retryCount;
}
else break;
Expand Down Expand Up @@ -1752,7 +1752,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
else jsonResult[advancedKeys[j]] = "invalidValue";
}

if(!cmdResult == Nuki::CmdResult::Success) {
if(cmdResult != Nuki::CmdResult::Success) {
++_retryCount;
}
else break;
Expand Down Expand Up @@ -2093,7 +2093,7 @@ void NukiWrapper::onKeypadJsonCommandReceived(const char *value)
}
}

if(!code == 12)
if(code != 12)
{
String codeStr = json["code"].as<String>();
bool codeValid = code > 100000 && code < 1000000 && (codeStr.indexOf('0') == -1);
Expand Down

0 comments on commit d3c3589

Please sign in to comment.