1
0

some debugging and modifying hooks functions to fetch parameters

This commit is contained in:
2022-01-05 00:01:41 +01:00
parent c97f05d2b6
commit 85a7fd7ed9
7 changed files with 81 additions and 31 deletions

View File

@ -93,8 +93,10 @@ function searchPropertyKey($fn, &$device, $object, $listPropertiesKeys)
}
if ( isset($value->property))
{
$string = $value->property;
//echo "property ===> " . $value->property . EOL;
$device->{$value->property} = null;
$device->{$string}["value"] = null;
$device->$string["functions"] = array();
}
}
//print_r($device);
@ -163,9 +165,14 @@ function iterateDevice($topic, $fn, &$device, $payloadArray)
{
$oldValue = $device->$key;
}if ($oldValue != $value)
}else
{
$device->{$key} = $value;
$device->{$key}["value"] = null;
$device->$key["functions"] = array();
}
if ($oldValue != $value)
{
$device->$key["value"] = $value;
$changed[$fn]["key"] = $key;
$changed[$fn]["value"] = $value;
@ -180,13 +187,13 @@ function iterateDevice($topic, $fn, &$device, $payloadArray)
echo " to " . $value . EOL;*/
}
//print_r($device->functions); print_r($value);
if (!empty($device->functions))
print_r($device);
if (!empty($device->$key["functions"]))
{
//echo "executing notifications functions " . EOL;
foreach($device->functions as $function)
echo "executing notifications functions " . EOL;
foreach($device->$key["functions"] as $function)
{
//print_r($function);
print_r($function);
$function($device, $key, $value);
}
}