modified device database and the code for managing it
This commit is contained in:
15
moha.php
15
moha.php
@ -10,7 +10,7 @@ $webServerIsActive = true;
|
||||
require "constants.php";
|
||||
|
||||
$listProperties = array("powerSource" => "batterie");
|
||||
$listPropertiesKeys = array("property");
|
||||
$listPropertiesKeys = array("expose");
|
||||
|
||||
//global variables
|
||||
$logLevel = ALL; // INFO | NOTICE | WARNING | ERROR | ALERT; //ALL;
|
||||
@ -18,7 +18,8 @@ $notificationLevel = ALERT | ERROR;
|
||||
$topics = array(); // list of topics
|
||||
$mids = array(); // list of message IDs
|
||||
$devices = array(); // array of device objetcs
|
||||
$indexDevices = array(); // index devices by ieee_address
|
||||
$indexDevices = array(); // index of devices by ieee_address
|
||||
$indexFriendlyNames = array(); // index of devices by freindly name
|
||||
$hooksList = array(); // list of hooks to be included
|
||||
$hooks = array(); // array of hooks
|
||||
$notificationMethods = array(); // array of notification methods objects
|
||||
@ -271,7 +272,7 @@ while (true)
|
||||
}else
|
||||
{
|
||||
|
||||
if ($oneshot === false) // execute once initialization finished :WARNING hooks can to be not initialized
|
||||
if ($oneshot === false) // execute while the first loop :WARNING hooks can to be not initialized
|
||||
{
|
||||
logger(DEBUG, _("Oneshot part of loop"), __FILE__ . ":" . __LINE__, false);
|
||||
|
||||
@ -284,7 +285,7 @@ while (true)
|
||||
{
|
||||
if ($hook->initialized === false)
|
||||
{
|
||||
logger(WARNING, _("Hook not completely initialized :") . $hookName, __FILE__ . ":" . __LINE__);
|
||||
logger(WARNING, _("Initializing Hook not completely initialized :") . $hookName, __FILE__ . ":" . __LINE__);
|
||||
$i &= $hook->installHooks();
|
||||
}
|
||||
}
|
||||
@ -293,7 +294,11 @@ while (true)
|
||||
{
|
||||
logger(DEBUG, _("All hooks initialized"), __FILE__ . ":" . __LINE__);
|
||||
$flagHooks = true;
|
||||
getDevicesValues();exit (0);
|
||||
|
||||
}else // executed when initialization finished
|
||||
{
|
||||
logger(DEBUG, _("looping"), __FILE__ . ":" . __LINE__);
|
||||
|
||||
}
|
||||
checkEvents();
|
||||
askWebServer($read);
|
||||
|
Reference in New Issue
Block a user