récupération après crash
This commit is contained in:
@ -606,22 +606,86 @@ function whoIsPresent($argList)
|
||||
|
||||
function test()
|
||||
{
|
||||
global $hooks;
|
||||
global $scripts;
|
||||
$portes = array();
|
||||
$msg = "";
|
||||
$msg = _("<b>Opened doors:</b>") . EOLH;
|
||||
|
||||
logger(DEBUG, _("Testing doors") , __FILE__ . ":" . __LINE__);
|
||||
echo "testing doors";
|
||||
$portes = $hooks["test_portes"]->testPortes();
|
||||
$portes = $scripts["test_portes"]->testPortes();
|
||||
if (!empty($portes))
|
||||
{
|
||||
$msg = _("Opened doors:") . EOLH;
|
||||
foreach($portes as $value)
|
||||
{
|
||||
$msg .= $value . EOL;
|
||||
}
|
||||
}else
|
||||
{
|
||||
$msg .= _("No doors opened");
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
||||
function unavailable()
|
||||
{
|
||||
global $indexDevices;
|
||||
$msg = _("<b>List of unavailable devices:</b>") . EOLH;
|
||||
foreach($indexDevices as $ieeeAddress => $device)
|
||||
{
|
||||
if (key_exists("availability", $device->properties))
|
||||
{
|
||||
if ($device->properties["availability"]["value"] == "offline")
|
||||
{
|
||||
$msg .= $device->friendlyName . EOLH;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
||||
function help()
|
||||
{
|
||||
$msg = "<table>";
|
||||
$msg .= "<tr><td><b>Commands</b></td><td><b>Description and Parameters</b></td>";
|
||||
$msg .= "<tr><td>browse</td><td>Browse device List<br>fn=friendlyname topic=topicname</td></tr>";
|
||||
$msg .= "<tr><td>dashboard</td><td>Display dashboards<br>Name of the dashboard</td></tr>";
|
||||
// $msg .= "<tr><td>deletedevice</td><td></td></tr>";
|
||||
$msg .= "<tr><td>disable</td><td>Disable a hook<br>name of the hook</td></tr>";
|
||||
$msg .= "<tr><td>dump</td><td>Display the content of a variable<br>variable name</td></tr>";
|
||||
$msg .= "<tr><td>enable</td><td>Enable a hook<br>name of the hook</td></tr>";
|
||||
$msg .= "<tr><td>friendlyname</td><td>Return friendlyname from ieeeadress<br>ieeeadress of device</td></tr>";
|
||||
$msg .= "<tr><td>get</td><td>Get value of the property of a device<br>fn=friendlyname, topic=topic name, property=property name</td></tr>";
|
||||
$msg .= "<tr><td>ispresent</td><td>Return the presence of a person<br>Name of the person</td></tr>";
|
||||
$msg .= "<tr><td>notify</td><td>Notify when property condition and value<br>topic, fn, property, condition, value</td></tr>";
|
||||
// $msg .= "<tr><td>type</td><td></td></tr>";
|
||||
$msg .= "<tr><td>present</td><td>List persons present</td></tr>";
|
||||
$msg .= "<tr><td>print</td><td>Dump the content of a variable<br>variable name</td></tr>";
|
||||
$msg .= "<tr><td>property</td><td>Display all devices with given property<br>Property to display</td></tr>";
|
||||
$msg .= "<tr><td>set</td><td>Set value of the property of a device<br>fn=friendlyname, topic=topic name, property=property name</td></tr>";
|
||||
$msg .= "<tr><td>test</td><td>Return all opened doors</td></tr>";
|
||||
$msg .= "<tr><td>unavailable</td><td>Displey all unavalaible devices</td></tr>";
|
||||
$msg .= "<tr><td>verbose</td><td>Enable or disable log levels<br>" . htmlDisplayLoglevels() . "</td></tr>";
|
||||
$msg .= "</table>";
|
||||
return $msg;
|
||||
}
|
||||
|
||||
function htmlDisplayLoglevels()
|
||||
{
|
||||
global $logLevels;
|
||||
$text = "";
|
||||
$flag = false;
|
||||
|
||||
foreach($logLevels as $level)
|
||||
{
|
||||
if ($flag === true)
|
||||
{
|
||||
$text .= " ,";
|
||||
}else
|
||||
{
|
||||
$flag = true;
|
||||
}
|
||||
$text .= $level;
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user