add more logs

master
Dirk Heilig 2024-09-23 11:47:51 +02:00
parent 1f069904bc
commit e1877d6761
1 changed files with 8 additions and 1 deletions

View File

@ -66,7 +66,6 @@ $mqtt->onMessage(function ($message) use (
&$isRunning,
$mqttTopic
) {
logit("got message");
if ($mqttTopic . "/restart" === $message->topic) {
$isRunning = false;
return;
@ -86,6 +85,14 @@ $mqtt->onMessage(function ($message) use (
$payload["timestamp"] = time();
$data[] = $payload;
$news = true;
logit(
"got message for " .
$payload["name"] .
": " .
implode(", ", $payload["labels"]) .
" with value " .
$payload["value"]
);
});
logit("Subscribing to $mqttTopic with QoS $qos ");