delay ble watchdog if lock command is finished
This commit is contained in:
@@ -220,6 +220,7 @@ void NukiOpenerWrapper::update()
|
||||
_nextLockAction = (NukiOpener::LockAction) 0xff;
|
||||
}
|
||||
}
|
||||
postponeBleWatchdog();
|
||||
}
|
||||
|
||||
if(_clearAuthData)
|
||||
@@ -280,12 +281,15 @@ void NukiOpenerWrapper::updateKeyTurnerState()
|
||||
{
|
||||
updateAuthData();
|
||||
}
|
||||
|
||||
postponeBleWatchdog();
|
||||
}
|
||||
|
||||
void NukiOpenerWrapper::updateBatteryState()
|
||||
{
|
||||
_nukiOpener.requestBatteryReport(&_batteryReport);
|
||||
_network->publishBatteryReport(_batteryReport);
|
||||
postponeBleWatchdog();
|
||||
}
|
||||
|
||||
void NukiOpenerWrapper::updateConfig()
|
||||
@@ -321,6 +325,12 @@ void NukiOpenerWrapper::updateAuthData()
|
||||
{
|
||||
_network->publishAuthorizationInfo(log);
|
||||
}
|
||||
postponeBleWatchdog();
|
||||
}
|
||||
|
||||
void NukiOpenerWrapper::postponeBleWatchdog()
|
||||
{
|
||||
_disableBleWatchdogTs = millis() + 15000;
|
||||
}
|
||||
|
||||
NukiOpener::LockAction NukiOpenerWrapper::lockActionToEnum(const char *str)
|
||||
@@ -410,6 +420,7 @@ void NukiOpenerWrapper::readConfig()
|
||||
char resultStr[20];
|
||||
NukiOpener::cmdResultToString(result, resultStr);
|
||||
Log->println(resultStr);
|
||||
postponeBleWatchdog();
|
||||
}
|
||||
|
||||
void NukiOpenerWrapper::readAdvancedConfig()
|
||||
@@ -420,6 +431,7 @@ void NukiOpenerWrapper::readAdvancedConfig()
|
||||
char resultStr[20];
|
||||
NukiOpener::cmdResultToString(result, resultStr);
|
||||
Log->println(resultStr);
|
||||
postponeBleWatchdog();
|
||||
}
|
||||
|
||||
void NukiOpenerWrapper::setupHASS()
|
||||
|
||||
@@ -39,6 +39,7 @@ private:
|
||||
void updateBatteryState();
|
||||
void updateConfig();
|
||||
void updateAuthData();
|
||||
void postponeBleWatchdog();
|
||||
|
||||
void readConfig();
|
||||
void readAdvancedConfig();
|
||||
@@ -85,5 +86,6 @@ private:
|
||||
unsigned long _nextPairTs = 0;
|
||||
long _nextRssiTs = 0;
|
||||
unsigned long _lastRssi = 0;
|
||||
unsigned long _disableBleWatchdogTs = 0;
|
||||
NukiOpener::LockAction _nextLockAction = (NukiOpener::LockAction)0xff;
|
||||
};
|
||||
|
||||
@@ -136,6 +136,7 @@ void NukiWrapper::update()
|
||||
if(_restartBeaconTimeout > 0 &&
|
||||
ts > 60000 &&
|
||||
lastReceivedBeaconTs > 0 &&
|
||||
_disableBleWatchdogTs < ts &&
|
||||
(ts - lastReceivedBeaconTs > _restartBeaconTimeout * 1000))
|
||||
{
|
||||
Log->print("No BLE beacon received from the lock for ");
|
||||
@@ -233,6 +234,7 @@ void NukiWrapper::update()
|
||||
_nextLockAction = (NukiLock::LockAction) 0xff;
|
||||
}
|
||||
}
|
||||
postponeBleWatchdog();
|
||||
}
|
||||
|
||||
if(_clearAuthData)
|
||||
@@ -292,12 +294,15 @@ void NukiWrapper::updateKeyTurnerState()
|
||||
{
|
||||
updateAuthData();
|
||||
}
|
||||
|
||||
postponeBleWatchdog();
|
||||
}
|
||||
|
||||
void NukiWrapper::updateBatteryState()
|
||||
{
|
||||
_nukiLock.requestBatteryReport(&_batteryReport);
|
||||
_network->publishBatteryReport(_batteryReport);
|
||||
postponeBleWatchdog();
|
||||
}
|
||||
|
||||
void NukiWrapper::updateConfig()
|
||||
@@ -335,6 +340,7 @@ void NukiWrapper::updateAuthData()
|
||||
{
|
||||
_network->publishAuthorizationInfo(log);
|
||||
}
|
||||
postponeBleWatchdog();
|
||||
}
|
||||
|
||||
void NukiWrapper::updateKeypad()
|
||||
@@ -363,6 +369,12 @@ void NukiWrapper::updateKeypad()
|
||||
_keypadCodeIds.push_back(entry.codeId);
|
||||
}
|
||||
}
|
||||
postponeBleWatchdog();
|
||||
}
|
||||
|
||||
void NukiWrapper::postponeBleWatchdog()
|
||||
{
|
||||
_disableBleWatchdogTs = millis() + 15000;
|
||||
}
|
||||
|
||||
NukiLock::LockAction NukiWrapper::lockActionToEnum(const char *str)
|
||||
|
||||
@@ -44,12 +44,12 @@ private:
|
||||
void updateConfig();
|
||||
void updateAuthData();
|
||||
void updateKeypad();
|
||||
void postponeBleWatchdog();
|
||||
|
||||
void readConfig();
|
||||
void readAdvancedConfig();
|
||||
|
||||
void setupHASS();
|
||||
|
||||
bool hasDoorSensor();
|
||||
|
||||
NukiLock::LockAction lockActionToEnum(const char* str); // char array at least 14 characters
|
||||
@@ -98,5 +98,6 @@ private:
|
||||
unsigned long _nextKeypadUpdateTs = 0;
|
||||
unsigned long _nextRssiTs = 0;
|
||||
unsigned long _lastRssi = 0;
|
||||
unsigned long _disableBleWatchdogTs = 0;
|
||||
NukiLock::LockAction _nextLockAction = (NukiLock::LockAction)0xff;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user