1
0

debugged notification of availability of devices

This commit is contained in:
2022-08-12 10:41:55 +02:00
parent 247d1fd17d
commit df94a6becf
18 changed files with 176 additions and 70 deletions

View File

@ -10,19 +10,31 @@ class hook
// list of devices we are listening to
function __construct()
{
logger(INFO, _("Initializing hook: ") . $this->hookName);
//$this->installHooks();
foreach ($this->devicelist as $ieeeAddress => $property)
if ($this->active === true)
{
$this->propertyInitialized[$ieeeAddress][$property] = false;
}
if (method_exists($this, "init"))
logger(INFO, _("Initializing hook: ") . $this->hookName);
//$this->installHooks();
if (method_exists($this, "init"))
{
$this->init();
}
if (method_exists($this, "iterate"))
{
$this->iterate();
}
foreach ($this->devicelist as $ieeeAddress => $property)
{
$this->propertyInitialized[$ieeeAddress][$property] = false;
}
}else
{
$this->init();
logger(INFO, _("Not initializing inactive hook: ") . $this->hookName);
}
}
function installHooks(&$indexDevices)
function installHooksFunction(&$indexDevices)
{
global $devices, $devicesRequest;
static $requestflag = 0;