debugging
This commit is contained in:
@ -2,28 +2,25 @@
|
||||
|
||||
class availability
|
||||
{
|
||||
public $hookname = "availability";
|
||||
public $initialized = true;
|
||||
// by default all devices are listening for availability
|
||||
|
||||
function __construct()
|
||||
{
|
||||
global $devices;
|
||||
$this->iterate($devices);
|
||||
$this->iterate();
|
||||
}
|
||||
|
||||
private function iterate(& $device)
|
||||
private function iterate()
|
||||
{
|
||||
foreach ($device as $key => $value)
|
||||
global $indexDevices;
|
||||
foreach ($indexDevices as $value)
|
||||
{
|
||||
if (gettype($value) == "array")
|
||||
{
|
||||
$this->iterate($value);
|
||||
}elseif (is_a($value, "device"))
|
||||
{
|
||||
|
||||
$value->availability["functions"][] = array($this,"callback");
|
||||
}
|
||||
$value->availability["functions"][] = array($this,"callback");
|
||||
}
|
||||
}
|
||||
|
||||
// callback fonction. Is called with these 3 parameters
|
||||
// $device -> calling device
|
||||
// $property -> parameter passed by mqtt
|
||||
|
Reference in New Issue
Block a user