Fix operators

This commit is contained in:
iranl
2024-08-25 17:43:45 +02:00
parent 8831bebe25
commit b2100ceeb7
2 changed files with 5 additions and 5 deletions

View File

@@ -1827,7 +1827,7 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value)
} }
} }
if(!code == 12) if(code != 12)
{ {
String codeStr = json["code"].as<String>(); String codeStr = json["code"].as<String>();
bool codeValid = code > 100000 && code < 1000000 && (codeStr.indexOf('0') == -1); bool codeValid = code > 100000 && code < 1000000 && (codeStr.indexOf('0') == -1);
@@ -2086,7 +2086,7 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value)
entry.codeId = codeId; entry.codeId = codeId;
entry.code = code; entry.code = code;
if(!name.length() > 0) if(name.length() < 1)
{ {
size_t nameLen = strlen(oldName); size_t nameLen = strlen(oldName);
memcpy(&entry.name, oldName, nameLen > 20 ? 20 : nameLen); memcpy(&entry.name, oldName, nameLen > 20 ? 20 : nameLen);

View File

@@ -1468,7 +1468,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
else jsonResult[basicKeys[i]] = "invalidValue"; else jsonResult[basicKeys[i]] = "invalidValue";
} }
if(!cmdResult == Nuki::CmdResult::Success) { if(cmdResult != Nuki::CmdResult::Success) {
++_retryCount; ++_retryCount;
} }
else break; else break;
@@ -1752,7 +1752,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
else jsonResult[advancedKeys[j]] = "invalidValue"; else jsonResult[advancedKeys[j]] = "invalidValue";
} }
if(!cmdResult == Nuki::CmdResult::Success) { if(cmdResult != Nuki::CmdResult::Success) {
++_retryCount; ++_retryCount;
} }
else break; else break;
@@ -2093,7 +2093,7 @@ void NukiWrapper::onKeypadJsonCommandReceived(const char *value)
} }
} }
if(!code == 12) if(code != 12)
{ {
String codeStr = json["code"].as<String>(); String codeStr = json["code"].as<String>();
bool codeValid = code > 100000 && code < 1000000 && (codeStr.indexOf('0') == -1); bool codeValid = code > 100000 && code < 1000000 && (codeStr.indexOf('0') == -1);