File tree 1 file changed +17
-12
lines changed
1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -1391,20 +1391,25 @@ void NukiLockComponent::dump_config() {
1391
1391
}
1392
1392
1393
1393
void NukiLockComponent::notify (Nuki::EventType event_type) {
1394
+ ESP_LOGI (TAG, " Event notified %d" , event_type);
1395
+
1396
+ if (event_type == Nuki::EventType::KeyTurnerStatusReset) {
1397
+ // IDK
1398
+ } else if (event_type == Nuki::EventType::ERROR_BAD_PIN) {
1399
+ // Invalid Pin
1400
+ } else if (event_type == Nuki::EventType::KeyTurnerStatusUpdated) {
1401
+ // Request status update
1402
+ this ->status_update_ = true ;
1394
1403
1395
- // Ignore bad pin error to prevent loop
1396
- if (event_type == Nuki::EventType::ERROR_BAD_PIN) {
1397
- return ;
1398
- }
1399
-
1400
- this ->status_update_ = true ;
1401
-
1402
- // Request event logs after every notify
1403
- if (this ->send_events_ ) {
1404
- this ->event_log_update_ = true ;
1404
+ // Request event logs
1405
+ if (this ->send_events_ ) {
1406
+ this ->event_log_update_ = true ;
1407
+ }
1408
+ } else if (event_type == Nuki::EventType::BLE_ERROR_ON_DISCONNECT) {
1409
+ ESP_LOGI (TAG, " Failed to disconnect from Nuki. Restarting ESP..." );
1410
+ delay (100 ); // NOLINT
1411
+ App.safe_reboot ();
1405
1412
}
1406
-
1407
- ESP_LOGI (TAG, " event notified %d" , event_type);
1408
1413
}
1409
1414
1410
1415
void NukiLockComponent::unpair () {
You can’t perform that action at this time.
0 commit comments