debugging hooks and events
This commit is contained in:
@ -189,10 +189,7 @@ function iterateDevice($topic, $fn, $parentDevice, &$device, $payloadArray, $pro
|
||||
{
|
||||
if (is_array($device->$key))
|
||||
{
|
||||
if (!empty($device->$key["value"]))
|
||||
{
|
||||
$oldValue = $device->$key["value"];
|
||||
}
|
||||
$oldValue = $device->$key["value"];
|
||||
}else
|
||||
{
|
||||
$oldValue = $device->$key;
|
||||
@ -202,6 +199,7 @@ function iterateDevice($topic, $fn, $parentDevice, &$device, $payloadArray, $pro
|
||||
$device->{$key} = array("value" => null);
|
||||
$device->$key["functions"] = array();
|
||||
}
|
||||
echo $key . 'oldvalue = ' . $oldValue . " value = " . $value . EOL;
|
||||
if ($oldValue !== $value)
|
||||
{
|
||||
$device->$key["value"] = $value;
|
||||
@ -209,13 +207,14 @@ function iterateDevice($topic, $fn, $parentDevice, &$device, $payloadArray, $pro
|
||||
//$changed[$fn]["value"] = $value;
|
||||
logger(INFO, sprintf(_("Device %s property %s, %s"), $fn, $propertyTree . $key, bool2string($value)));
|
||||
$mohaDB->logProperty($parentDevice, $propertyTree . $key, $value, $oldValue);
|
||||
}
|
||||
if (!empty($device->$key["functions"]))
|
||||
{
|
||||
logger(DEBUG,_("executing notifications functions"));
|
||||
foreach($device->$key["functions"] as $function)
|
||||
print_r($device->$key);
|
||||
if (!empty($device->$key["functions"]))
|
||||
{
|
||||
$function($device, $key, $value);
|
||||
logger(DEBUG,_("executing notifications functions"));
|
||||
foreach($device->$key["functions"] as $function)
|
||||
{
|
||||
$function($device, $key, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
Reference in New Issue
Block a user