add check to send a maximum of 5 log entries

This commit is contained in:
technyon
2024-01-27 13:15:26 +01:00
parent 8c8f524e6d
commit dd0967f5ab
4 changed files with 14 additions and 1 deletions

View File

@@ -307,8 +307,14 @@ void NetworkLock::publishAuthorizationInfo(const std::list<NukiLock::LogEntry>&
DynamicJsonDocument json(_bufferSize);
int i = 5;
for(const auto& log : logEntries)
{
if(i <= 0)
{
break;
}
--i;
if((log.loggingType == NukiLock::LoggingType::LockAction || log.loggingType == NukiLock::LoggingType::KeypadAction) && ! authFound)
{
authFound = true;