diff --git a/components/nuki_lock/nuki_lock.cpp b/components/nuki_lock/nuki_lock.cpp index 93d7e51..aba1b50 100644 --- a/components/nuki_lock/nuki_lock.cpp +++ b/components/nuki_lock/nuki_lock.cpp @@ -450,9 +450,14 @@ void NukiLockComponent::update_auth_data() ESP_LOGD(TAG, "retrieveAuthorizationEntries has resulted in %s (%d)", auth_data_req_result_as_string, auth_data_req_result); this->set_timeout("wait_for_auth_data", 5000, [this]() { + + ESP_LOGD(TAG, "wait_for_auth_data done"); + std::list authEntries; this->nuki_lock_.getAuthorizationEntries(&authEntries); + ESP_LOGD(TAG, "getAuthorizationEntries done: %d", authEntries.size()); + authEntries.sort([](const NukiLock::AuthorizationEntry& a, const NukiLock::AuthorizationEntry& b) { return a.authId < b.authId; @@ -495,22 +500,28 @@ void NukiLockComponent::update_event_logs() ESP_LOGD(TAG, "retrieveLogEntries has resulted in %s (%d)", event_log_req_result_as_string, event_log_req_result); this->set_timeout("wait_for_log_entries", 5000, [this]() { + + ESP_LOGD(TAG, "getLogEntries"); + + std::list log; this->nuki_lock_.getLogEntries(&log); - if(log.size() > MAX_EVENT_LOG_ENTRIES) - { + ESP_LOGD(TAG, "getLogEntries done: %d", log.size()); + + if(log.size() > MAX_EVENT_LOG_ENTRIES) { + ESP_LOGD(TAG, "resize"); log.resize(MAX_EVENT_LOG_ENTRIES); } - log.sort([](const NukiLock::LogEntry& a, const NukiLock::LogEntry& b) - { + log.sort([](const NukiLock::LogEntry& a, const NukiLock::LogEntry& b) { return a.index < b.index; }); - if(log.size() > 0) - { + if(log.size() > 0) { this->process_log_entries(log); + } else { + ESP_LOGD(TAG, "No log entries"); } });