Validate PIN
This commit is contained in:
@@ -412,6 +412,31 @@ void NukiOpenerWrapper::updateConfig()
|
||||
_hardwareVersion = std::to_string(_nukiConfig.hardwareRevision[0]) + "." + std::to_string(_nukiConfig.hardwareRevision[1]);
|
||||
_network->publishConfig(_nukiConfig);
|
||||
_retryConfigCount = 0;
|
||||
|
||||
const int pinStatus = _preferences->getInt(preference_opener_pin_status, 4);
|
||||
|
||||
if(isPinSet()) {
|
||||
Nuki::CmdResult result = _nukiOpener.verifySecurityPin();
|
||||
|
||||
if(result != Nuki::CmdResult::Success)
|
||||
{
|
||||
if(pinStatus != 2) {
|
||||
_preferences->putInt(preference_opener_pin_status, 2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pinStatus != 1) {
|
||||
_preferences->putInt(preference_opener_pin_status, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pinStatus != 0) {
|
||||
_preferences->putInt(preference_opener_pin_status, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user