Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Mar 23, 2024
1 parent 5ea0ad6 commit cb5c1a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions components/nuki_lock/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
cv.Required(CONF_IS_PAIRED): binary_sensor.binary_sensor_schema(
device_class=DEVICE_CLASS_CONNECTIVITY,
),
cv.Optional(CONF_IS_PAIRING): binary_sensor.binary_sensor_schema(
device_class=DEVICE_CLASS_CONNECTIVITY,
),
cv.Optional(CONF_IS_PAIRING): binary_sensor.binary_sensor_schema(),
cv.Optional(CONF_BATTERY_CRITICAL): binary_sensor.binary_sensor_schema(
device_class=DEVICE_CLASS_BATTERY,
),
Expand Down
8 changes: 4 additions & 4 deletions components/nuki_lock/nuki_lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,15 @@ void NukiLockComponent::setup() {
this->status_update_ = true;
ESP_LOGI(TAG, "%s Nuki paired", this->deviceName_);
this->is_paired_->publish_initial_state(true);
//this->is_pairing_->publish_initial_state(false);
this->is_pairing_->publish_initial_state(false);
}
else {
ESP_LOGW(TAG, "%s Nuki is not paired", this->deviceName_);
this->is_paired_->publish_initial_state(false);

// Pairing Mode
ESP_LOGI(TAG, "Waiting for Nuki in pairing mode...");
//this->is_pairing_->publish_initial_state(true);
this->is_pairing_->publish_initial_state(true);
}

this->publish_state(lock::LOCK_STATE_NONE);
Expand Down Expand Up @@ -272,7 +272,7 @@ void NukiLockComponent::update() {
}
else {
ESP_LOGI(TAG, "Waiting for Nuki in pairing mode...");
//this->is_pairing_->publish_state(true);
this->is_pairing_->publish_state(true);

// Pair Nuki
bool paired = (this->nukiLock_.pairNuki() == Nuki::PairingResult::Success);
Expand All @@ -282,7 +282,7 @@ void NukiLockComponent::update() {
}
this->is_paired_->publish_state(paired);

//this->is_pairing_->publish_state(false);
this->is_pairing_->publish_state(false);
}
}

Expand Down

0 comments on commit cb5c1a0

Please sign in to comment.