1
0
This commit is contained in:
2022-09-05 13:47:41 +02:00
parent 0c9f8f8c3f
commit 4acb2992ca
15 changed files with 82 additions and 53 deletions

View File

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