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