some debugging and modifying hooks functions to fetch parameters
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user