fix: remove extra quotes
parent
5a237e8c81
commit
1f91f2c7f3
|
@ -35,10 +35,11 @@ $c->onMessage(function (\Mosquitto\Message $message) use (&$data, $conf) {
|
||||||
" unknown\n";
|
" unknown\n";
|
||||||
die(1);
|
die(1);
|
||||||
}
|
}
|
||||||
|
var_dump($data);
|
||||||
$data[$message->topic]["changed"] = time();
|
$data[$message->topic]["changed"] = time();
|
||||||
$out = file_get_contents(__DIR__ . "/template.json");
|
$out = file_get_contents(__DIR__ . "/template.json");
|
||||||
$out = preg_replace_callback(
|
$out = preg_replace_callback(
|
||||||
"/{{(?<name>[^#}]+?)(#(?<modifier>[^}]+))?}}/",
|
"/\"{{(?<name>[^#}]+?)(#(?<modifier>[^}]+))?}}\"/",
|
||||||
function ($m) use ($data, $conf) {
|
function ($m) use ($data, $conf) {
|
||||||
$value = $data[$conf["variables"][$m["name"]]["topic"]]["value"];
|
$value = $data[$conf["variables"][$m["name"]]["topic"]]["value"];
|
||||||
$modifier = isset($m["modifier"]) ? $m["modifier"] : "noop";
|
$modifier = isset($m["modifier"]) ? $m["modifier"] : "noop";
|
||||||
|
|
Loading…
Reference in New Issue