adding command test in apiserver\nsome debugging\nfree sms now running fine
This commit is contained in:
@@ -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"))
|
||||
{
|
||||
|
Reference in New Issue
Block a user