1
0

adding command test in apiserver\nsome debugging\nfree sms now running fine

This commit is contained in:
2022-07-10 19:33:19 +02:00
parent 97f8050d29
commit 555abb7c88
14 changed files with 182 additions and 66 deletions

View File

@@ -4,7 +4,7 @@ if (!array_key_exists("pws2mqtt", $devices)) $devices["pws2mqtt"] = array();
function pws2mqttCallback($topic, $message)
{
global $logFh, $devices, $included;
global $logFh, $devices, $included, $topics;
$topicName = $topic[0];
$fn = $topic[1];
logger(INFO, sprintf(_("Incoming notification of device %s => friendly name : %s"), $topicName, $fn), __FILE__ . ":" . __LINE__);
@@ -30,6 +30,7 @@ function pws2mqttCallback($topic, $message)
{
$device = &$device[$fn];
}
$topics[$topicName]->lastSeen = time();
unset($payloadArray["friendly_name"]);
unset($payloadArray["ieeeAddress"]);
unset($payloadArray["type"]);
@@ -60,6 +61,8 @@ function pws2mqttCallback($topic, $message)
}
};
$topics["pws2mqtt"]->callback = "pws2mqttCallback";
$topics["pws2mqtt"]->timeOut = 3; //timeOut in minutes
$topics["pws2mqtt"]->lastSeen = time();
if (!is_callable("pws2mqttGetList"))
{