uriyacovy / ESPHome_nuki_lock

ESPHome lock platform for Nuki Smartlock
MIT License
60 stars 19 forks source link

Compilation issue under ESPHome - home assistant 2022.12.8 #17

Closed Jejebond closed 1 year ago

Jejebond commented 1 year ago

Hi ! I've got this compilation issue under ESPHome - home assistant 2022.12.8, any idea ?

src/esphome/components/nuki_lock/nuki_lock.h:50:50: error: 'Nuki::LockState' has not been declared
         lock::LockState nuki_to_lock_state(Nuki::LockState);
                                                  ^~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.h:65:9: error: 'BleScanner' does not name a type
         BleScanner scanner_;
         ^~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.h:66:15: error: 'KeyTurnerState' in namespace 'Nuki' does not name a type
         Nuki::KeyTurnerState retrievedKeyTurnerState_;
               ^~~~~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:7:52: error: 'esphome::lock::LockState esphome::nuki_lock::NukiLock::nuki_to_lock_state' is not a static data member of 'class esphome::nuki_lock::NukiLock'
 lock::LockState NukiLock::nuki_to_lock_state(Nuki::LockState nukiLockState) {
                                                    ^~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:7:52: error: 'LockState' is not a member of 'Nuki'
src/esphome/components/nuki_lock/nuki_lock.cpp:7:52: note: suggested alternative: 'CommandState'
 lock::LockState NukiLock::nuki_to_lock_state(Nuki::LockState nukiLockState) {
                                                    ^~~~~~~~~
                                                    CommandState
src/esphome/components/nuki_lock/nuki_lock.cpp: In member function 'void esphome::nuki_lock::NukiLock::update_status()':
src/esphome/components/nuki_lock/nuki_lock.cpp:55:38: error: 'class Nuki::NukiBle' has no member named 'requestKeyTurnerState'
     uint8_t result = this->nukiBle_->requestKeyTurnerState(&(this->retrievedKeyTurnerState_));
                                      ^~~~~~~~~~~~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:55:68: error: 'class esphome::nuki_lock::NukiLock' has no member named 'retrievedKeyTurnerState_'
     uint8_t result = this->nukiBle_->requestKeyTurnerState(&(this->retrievedKeyTurnerState_));
                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/esphome/components/nuki_lock/nuki_lock.cpp:1:
src/esphome/components/nuki_lock/nuki_lock.cpp:58:17: error: 'class esphome::nuki_lock::NukiLock' has no member named 'retrievedKeyTurnerState_'
           this->retrievedKeyTurnerState_.criticalBatteryState,
                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:105:88: note: in definition of macro 'esph_log_i'
   esp_log_printf_(ESPHOME_LOG_LEVEL_INFO, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                        ^~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:57:9: note: in expansion of macro 'ESP_LOGI'
         ESP_LOGI(TAG, "Bat state: %#x, Bat crit: %d, Bat perc:%d lock state: %d %d:%d:%d",
         ^~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:59:27: error: 'class Nuki::NukiBle' has no member named 'isBatteryCritical'
           this->nukiBle_->isBatteryCritical(), this->nukiBle_->getBatteryPerc(), this->retrievedKeyTurnerState_.lockState,
                           ^~~~~~~~~~~~~~~~~
src/esphome/core/log.h:105:88: note: in definition of macro 'esph_log_i'
   esp_log_printf_(ESPHOME_LOG_LEVEL_INFO, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                        ^~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:57:9: note: in expansion of macro 'ESP_LOGI'
         ESP_LOGI(TAG, "Bat state: %#x, Bat crit: %d, Bat perc:%d lock state: %d %d:%d:%d",
         ^~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:59:64: error: 'class Nuki::NukiBle' has no member named 'getBatteryPerc'
           this->nukiBle_->isBatteryCritical(), this->nukiBle_->getBatteryPerc(), this->retrievedKeyTurnerState_.lockState,
                                                                ^~~~~~~~~~~~~~
src/esphome/core/log.h:105:88: note: in definition of macro 'esph_log_i'
   esp_log_printf_(ESPHOME_LOG_LEVEL_INFO, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                        ^~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:57:9: note: in expansion of macro 'ESP_LOGI'
Compiling /data/nuki/.pioenvs/nuki/src/esphome/components/ota/ota_backend_arduino_esp8266.cpp.o
         ESP_LOGI(TAG, "Bat state: %#x, Bat crit: %d, Bat perc:%d lock state: %d %d:%d:%d",
         ^~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:59:88: error: 'class esphome::nuki_lock::NukiLock' has no member named 'retrievedKeyTurnerState_'
           this->nukiBle_->isBatteryCritical(), this->nukiBle_->getBatteryPerc(), this->retrievedKeyTurnerState_.lockState,
                                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:105:88: note: in definition of macro 'esph_log_i'
   esp_log_printf_(ESPHOME_LOG_LEVEL_INFO, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                        ^~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:57:9: note: in expansion of macro 'ESP_LOGI'
         ESP_LOGI(TAG, "Bat state: %#x, Bat crit: %d, Bat perc:%d lock state: %d %d:%d:%d",
         ^~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:60:17: error: 'class esphome::nuki_lock::NukiLock' has no member named 'retrievedKeyTurnerState_'
           this->retrievedKeyTurnerState_.currentTimeHour,
                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:105:88: note: in definition of macro 'esph_log_i'
   esp_log_printf_(ESPHOME_LOG_LEVEL_INFO, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                        ^~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:57:9: note: in expansion of macro 'ESP_LOGI'
         ESP_LOGI(TAG, "Bat state: %#x, Bat crit: %d, Bat perc:%d lock state: %d %d:%d:%d",
         ^~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:61:17: error: 'class esphome::nuki_lock::NukiLock' has no member named 'retrievedKeyTurnerState_'
           this->retrievedKeyTurnerState_.currentTimeMinute,
                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:105:88: note: in definition of macro 'esph_log_i'
   esp_log_printf_(ESPHOME_LOG_LEVEL_INFO, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                        ^~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:57:9: note: in expansion of macro 'ESP_LOGI'
         ESP_LOGI(TAG, "Bat state: %#x, Bat crit: %d, Bat perc:%d lock state: %d %d:%d:%d",
         ^~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:62:17: error: 'class esphome::nuki_lock::NukiLock' has no member named 'retrievedKeyTurnerState_'
           this->retrievedKeyTurnerState_.currentTimeSecond);
                 ^~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:105:88: note: in definition of macro 'esph_log_i'
   esp_log_printf_(ESPHOME_LOG_LEVEL_INFO, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                        ^~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:57:9: note: in expansion of macro 'ESP_LOGI'
         ESP_LOGI(TAG, "Bat state: %#x, Bat crit: %d, Bat perc:%d lock state: %d %d:%d:%d",
         ^~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:63:60: error: 'class esphome::nuki_lock::NukiLock' has no member named 'retrievedKeyTurnerState_'
         this->publish_state(this->nuki_to_lock_state(this->retrievedKeyTurnerState_.lockState));
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:65:68: error: 'class Nuki::NukiBle' has no member named 'isBatteryCritical'
             this->battery_critical_->publish_state(this->nukiBle_->isBatteryCritical());
                                                                    ^~~~~~~~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:67:65: error: 'class Nuki::NukiBle' has no member named 'getBatteryPerc'
             this->battery_level_->publish_state(this->nukiBle_->getBatteryPerc());
                                                                 ^~~~~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:69:85: error: 'class esphome::nuki_lock::NukiLock' has no member named 'retrievedKeyTurnerState_'
             this->door_sensor_->publish_state(this->nuki_doorsensor_to_binary(this->retrievedKeyTurnerState_.doorSensorState));
                                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:71:91: error: 'class esphome::nuki_lock::NukiLock' has no member named 'retrievedKeyTurnerState_'
             this->door_sensor_state_->publish_state(this->nuki_doorsensor_to_string(this->retrievedKeyTurnerState_.doorSensorState));
                                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp: In member function 'virtual void esphome::nuki_lock::NukiLock::setup()':
src/esphome/components/nuki_lock/nuki_lock.cpp:80:74: error: invalid new-expression of abstract class type 'Nuki::NukiBle'
     this->nukiBle_ = new Nuki::NukiBle(this->deviceName_, this->deviceId_);
                                                                          ^
In file included from src/esphome/components/nuki_lock/nuki_lock.h:9,
                 from src/esphome/components/nuki_lock/nuki_lock.cpp:2:
/data/nuki/.piolibdeps/nuki/NukiBleEsp/src/NukiBle.h:29:7: note:   because the following virtual functions are pure within 'Nuki::NukiBle':
 class NukiBle : public BLEClientCallbacks, public BleScanner::Subscriber {
       ^~~~~~~
/data/nuki/.piolibdeps/nuki/NukiBleEsp/src/NukiBle.h:264:18: note:  'virtual void Nuki::NukiBle::logErrorCode(uint8_t)'
     virtual void logErrorCode(uint8_t errorCode) = 0;
                  ^~~~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:86:11: error: 'class esphome::nuki_lock::NukiLock' has no member named 'scanner_'; did you mean 'handler_'?
     this->scanner_.initialize();
           ^~~~~~~~
           handler_
src/esphome/components/nuki_lock/nuki_lock.cpp:87:47: error: 'class esphome::nuki_lock::NukiLock' has no member named 'scanner_'; did you mean 'handler_'?
     this->nukiBle_->registerBleScanner(&this->scanner_);
                                               ^~~~~~~~
                                               handler_
src/esphome/components/nuki_lock/nuki_lock.cpp: In member function 'virtual void esphome::nuki_lock::NukiLock::update()':
src/esphome/components/nuki_lock/nuki_lock.cpp:111:11: error: 'class esphome::nuki_lock::NukiLock' has no member named 'scanner_'; did you mean 'handler_'?
     this->scanner_.update();
           ^~~~~~~~
           handler_
src/esphome/components/nuki_lock/nuki_lock.cpp:120:48: error: cannot convert 'Nuki::PairingResult' to 'bool' in initialization
         bool paired = this->nukiBle_->pairNuki();
                                                ^
src/esphome/components/nuki_lock/nuki_lock.cpp: In member function 'virtual void esphome::nuki_lock::NukiLock::control(const esphome::lock::LockCall&)':
src/esphome/components/nuki_lock/nuki_lock.cpp:136:38: error: 'class Nuki::NukiBle' has no member named 'lockAction'; did you mean 'executeAction'?
             result = this->nukiBle_->lockAction(Nuki::LockAction::Lock);
                                      ^~~~~~~~~~
                                      executeAction
src/esphome/components/nuki_lock/nuki_lock.cpp:136:55: error: 'Nuki::LockAction' has not been declared
             result = this->nukiBle_->lockAction(Nuki::LockAction::Lock);
                                                       ^~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:138:38: error: 'class Nuki::NukiBle' has no member named 'lockAction'; did you mean 'executeAction'?
             result = this->nukiBle_->lockAction(this->open_latch_ ? Nuki::LockAction::Unlatch : Nuki::LockAction::Unlock);
                                      ^~~~~~~~~~
                                      executeAction
src/esphome/components/nuki_lock/nuki_lock.cpp:138:75: error: 'Nuki::LockAction' has not been declared
             result = this->nukiBle_->lockAction(this->open_latch_ ? Nuki::LockAction::Unlatch : Nuki::LockAction::Unlock);
                                                                           ^~~~~~~~~~
src/esphome/components/nuki_lock/nuki_lock.cpp:138:103: error: 'Nuki::LockAction' has not been declared
             result = this->nukiBle_->lockAction(this->open_latch_ ? Nuki::LockAction::Unlatch : Nuki::LockAction::Unlock);
                                                                                                       ^~~~~~~~~~
Compiling /data/nuki/.pioenvs/nuki/src/esphome/components/ota/ota_backend_arduino_rp2040.cpp.o
Compiling /data/nuki/.pioenvs/nuki/src/esphome/components/ota/ota_backend_esp_idf.cpp.o
*** [/data/nuki/.pioenvs/nuki/src/esphome/components/nuki_lock/nuki_lock.cpp.o] Error 1
========================= [FAILED] Took 78.12 seconds =========================

logs_nuki_upload.txt

uriyacovy commented 1 year ago

You need to use the dev branch for now. See here: https://github.com/uriyacovy/ESPHome_nuki_lock/issues/15#issuecomment-1351419332

Jejebond commented 1 year ago

Thanks. Now i have this in loop after flashing. Can't pair with Nuki

'''[ 42837][E][Preferences.cpp:503] getBytesLength(): nvs_get_blob len fail: bleAddress NOT_FOUND'''

uriyacovy commented 1 year ago

Can you try again with the main branch?

uriyacovy commented 1 year ago

Should be solved.