fix pairing

This commit is contained in:
technyon
2022-04-02 16:09:56 +02:00
parent abea094b08
commit 9792110461
3 changed files with 4 additions and 1 deletions

View File

@@ -52,6 +52,8 @@ void NukiWrapper::update()
if (!_paired) {
Serial.println(F("Nuki start pairing"));
_bleScanner.update();
vTaskDelay( 5000 / portTICK_PERIOD_MS);
if (_nukiBle.pairNuki()) {
Serial.println(F("Nuki paired"));
_paired = true;

View File

@@ -42,5 +42,6 @@ private:
bool _statusUpdated = false;
unsigned long _nextLockStateUpdateTs = 0;
unsigned long _nextBatteryReportTs = 0;
unsigned long _nextPairTs = 0;
Nuki::LockAction _nextLockAction = (Nuki::LockAction)0xff;
};

View File

@@ -39,7 +39,7 @@ void setup()
preferences = new Preferences();
preferences->begin("nukihub", false);
network = new Network(preferences);
nuki = new NukiWrapper("Main Door", 2020001, network, preferences);
nuki = new NukiWrapper("ESP", 2020001, network, preferences);
webCfgServer = new WebCfgServer(nuki, network, preferences);
network->initialize();