Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Mar 23, 2024
1 parent 78c6496 commit 5b188d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions components/nuki_lock/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

CONF_IS_CONNECTED = "is_connected"
CONF_IS_PAIRED = "is_paired"
#CONF_IS_PAIRING = "is_pairing"
CONF_IS_PAIRING = "is_pairing"
CONF_UNPAIR_BUTTON = "unpair"
CONF_BATTERY_CRITICAL = "battery_critical"
CONF_BATTERY_LEVEL = "battery_level"
Expand All @@ -32,9 +32,9 @@
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(
device_class=DEVICE_CLASS_CONNECTIVITY,
),
cv.Optional(CONF_BATTERY_CRITICAL): binary_sensor.binary_sensor_schema(
device_class=DEVICE_CLASS_BATTERY,
),
Expand Down Expand Up @@ -67,9 +67,9 @@ async def to_code(config):
sens = await binary_sensor.new_binary_sensor(config[CONF_IS_PAIRED])
cg.add(var.set_is_paired(sens))

#if CONF_IS_PAIRING in config:
# sens = await binary_sensor.new_binary_sensor(config[CONF_IS_PAIRING])
# cg.add(var.set_is_pairing(sens))
if CONF_IS_PAIRING in config:
sens = await binary_sensor.new_binary_sensor(config[CONF_IS_PAIRING])
cg.add(var.set_is_pairing(sens))

if CONF_BATTERY_CRITICAL in config:
sens = await binary_sensor.new_binary_sensor(config[CONF_BATTERY_CRITICAL])
Expand Down
4 changes: 2 additions & 2 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
4 changes: 2 additions & 2 deletions components/nuki_lock/nuki_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class NukiLockComponent : public lock::Lock, public PollingComponent, public api

void set_is_connected(binary_sensor::BinarySensor *is_connected) { this->is_connected_ = is_connected; }
void set_is_paired(binary_sensor::BinarySensor *is_paired) { this->is_paired_ = is_paired; }
//void set_is_pairing(binary_sensor::BinarySensor *is_pairing) { this->is_pairing_ = is_pairing; }
void set_is_pairing(binary_sensor::BinarySensor *is_pairing) { this->is_pairing_ = is_pairing; }
void set_battery_critical(binary_sensor::BinarySensor *battery_critical) { this->battery_critical_ = battery_critical; }
void set_battery_level(sensor::Sensor *battery_level) { this->battery_level_ = battery_level; }
void set_door_sensor(binary_sensor::BinarySensor *door_sensor) { this->door_sensor_ = door_sensor; }
Expand Down Expand Up @@ -70,7 +70,7 @@ class NukiLockComponent : public lock::Lock, public PollingComponent, public api

binary_sensor::BinarySensor *is_connected_{nullptr};
binary_sensor::BinarySensor *is_paired_{nullptr};
//binary_sensor::BinarySensor *is_pairing_{nullptr};
binary_sensor::BinarySensor *is_pairing_{nullptr};
binary_sensor::BinarySensor *battery_critical_{nullptr};
binary_sensor::BinarySensor *door_sensor_{nullptr};
text_sensor::TextSensor *door_sensor_state_{nullptr};
Expand Down

0 comments on commit 5b188d1

Please sign in to comment.