Skip to content

Commit

Permalink
Prevent bad pin loop
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Jan 13, 2025
1 parent 7e3f428 commit 7c0fb55
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/nuki_lock/nuki_lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ void NukiLockComponent::setup() {
if (!this->pref_.load(&recovered)) {
recovered = {0};
}

if(recovered.security_pin != 0)
{
this->security_pin_ = recovered.security_pin;
Expand Down Expand Up @@ -1125,6 +1125,12 @@ void NukiLockComponent::dump_config() {
}

void NukiLockComponent::notify(Nuki::EventType event_type) {

// Ignore bad pin error to prevent loop
if(event_type == Nuki::EventType::ERROR_BAD_PIN) {
return;
}

this->status_update_ = true;
this->config_update_ = true;
this->advanced_config_update_ = true;
Expand Down

0 comments on commit 7c0fb55

Please sign in to comment.