add debug
parent
77c10057fa
commit
30943f2a6b
|
@ -64,12 +64,28 @@ $mqtt->onMessage(function ($message) use (
|
||||||
&$news,
|
&$news,
|
||||||
&$globalCounter,
|
&$globalCounter,
|
||||||
&$isRunning,
|
&$isRunning,
|
||||||
|
$mqtt,
|
||||||
$mqttTopic
|
$mqttTopic
|
||||||
) {
|
) {
|
||||||
if ($mqttTopic . "/restart" === $message->topic) {
|
if ($mqttTopic . "/restart" === $message->topic) {
|
||||||
$isRunning = false;
|
$isRunning = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ($mqttTopic . "/debug" === $message->topic) {
|
||||||
|
$mqtt->publish(
|
||||||
|
$mqttTopic . "/debug",
|
||||||
|
strval(
|
||||||
|
json_encode(
|
||||||
|
$data,
|
||||||
|
JSON_UNESCAPED_SLASHES +
|
||||||
|
JSON_UNESCAPED_UNICODE +
|
||||||
|
JSON_PRETTY_PRINT
|
||||||
|
)
|
||||||
|
),
|
||||||
|
2
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
$globalCounter++;
|
$globalCounter++;
|
||||||
$stats["messages"][] = time();
|
$stats["messages"][] = time();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue