master
Dirk Heilig 2024-09-09 19:22:32 +02:00
parent af207d8a01
commit f61c21fbad
1 changed files with 3 additions and 3 deletions

View File

@ -80,6 +80,9 @@ $mqtt->onMessage(function ($message) use (
$payload = (array) json_decode($message->payload, true);
$payload["timestamp"] = time();
if (!isset($payload["valid_seconds"])) {
$payload["valid_seconds"] = 60;
}
$data[] = $payload;
$news = true;
});
@ -174,9 +177,6 @@ function precheck(Message $message): bool
}
}
if (!isset($payload["valid_seconds"])) {
$payload["valid_seconds"] = 60;
}
if (!is_numeric($payload["valid_seconds"])) {
error("valid_seconds must be a number");
return false;