Minor fixes

This commit is contained in:
iranl
2024-11-03 15:30:21 +01:00
parent d6c77670fe
commit 481d18cc28
3 changed files with 90 additions and 87 deletions

View File

@@ -359,16 +359,16 @@ void NukiWrapper::update()
_nextLockAction = (NukiLock::LockAction) 0xff;
}
}
if(_nukiOfficial->getStatusUpdated() || _statusUpdated || _nextLockStateUpdateTs == 0 || ts >= _nextLockStateUpdateTs || (queryCommands & QUERY_COMMAND_LOCKSTATE) > 0)
{
Log->println("Updating Lock state based on status, timer or query");
_statusUpdated = false;
_nextLockStateUpdateTs = ts + _intervalLockstate * 1000;
updateKeyTurnerState();
_network->publishStatusUpdated(_statusUpdated);
}
if(_network->mqttConnectionState() == 2)
{
if(_nukiOfficial->getStatusUpdated() || _statusUpdated || _nextLockStateUpdateTs == 0 || ts >= _nextLockStateUpdateTs || (queryCommands & QUERY_COMMAND_LOCKSTATE) > 0)
{
Log->println("Updating Lock state based on status, timer or query");
_statusUpdated = false;
_nextLockStateUpdateTs = ts + _intervalLockstate * 1000;
updateKeyTurnerState();
_network->publishStatusUpdated(_statusUpdated);
}
if(!_statusUpdated)
{
if(_nextBatteryReportTs == 0 || ts > _nextBatteryReportTs || (queryCommands & QUERY_COMMAND_BATTERY) > 0)
@@ -4001,6 +4001,7 @@ void NukiWrapper::notify(Nuki::EventType eventType)
if(eventType == Nuki::EventType::KeyTurnerStatusReset)
{
_newSignal = false;
Log->println("KeyTurnerStatusReset");
}
else if(eventType == Nuki::EventType::KeyTurnerStatusUpdated)
{