diff --git a/apiserver/cmd_functions.php b/apiserver/cmd_functions.php index f30a10a..27ff412 100644 --- a/apiserver/cmd_functions.php +++ b/apiserver/cmd_functions.php @@ -507,7 +507,7 @@ function PropertiesDashboard($argList) $response .= 'friendlyName . "/" . $propertyObject["name"] . '" value="' . _("Update") . "\" onmouseup=\"getPropertyValue('" . $device->topic . "','" . $device->friendlyName . "','" . $propertyObject["name"] . "')\">"; }else { - $response .= $value; + $response .= bool2string($value); } $response .= EOLH; }else diff --git a/config/liste_telephones.php b/config/liste_telephones.php new file mode 100644 index 0000000..353b36c --- /dev/null +++ b/config/liste_telephones.php @@ -0,0 +1,6 @@ + "84:CF:BF:8E:E6:A6" +); + +?> diff --git a/hooks/scripts/rdc_portes_ouvertes.php b/hooks/scripts/rdc_portes_ouvertes.php index 54ee1f6..a85c525 100644 --- a/hooks/scripts/rdc_portes_ouvertes.php +++ b/hooks/scripts/rdc_portes_ouvertes.php @@ -43,26 +43,34 @@ class alerte_intrusion extends hook } } - public function testPortes($send=true, $opened=true) :array + public function testPortes($deviceList=false, $send=true, $opened=true) :array { global $indexDevices; $portes = array(); + logger(DEBUG, _("Function alerte_intrusion->testPorte"), __FILE__ . ":" . __LINE__); + if ($deviceList === false) $deviceList = $this->deviceList; $msg = ""; - foreach ($this->devicelist as $device => $property) + foreach ($deviceList as $device => $property) { - if (!$opened) + //echo "device: " . $device . "\n"; + //echo "opened = " . bool2string($opened); + //echo " value = " . var_dump($indexDevices[$device]->properties[$property]); + + if ($opened) { - if($indexDevices[$device]->properties[$property] == false) + if($indexDevices[$device]->properties[$property]["value"] === false) { + //echo "porte opened"; $portes[] = $indexDevices[$device]->friendlyName; $msg .= $indexDevices[$device]->friendlyName . "\n"; } }else { - if($indexDevices[$device]->properties[$property] == true) + if($indexDevices[$device]->properties[$property]["value"] === true) { + //echo "porte closed"; $portes[] = $indexDevices[$device]->friendlyName; $msg .= $indexDevices[$device]->friendlyName . "\n"; } diff --git a/presence.php b/presence.php new file mode 100644 index 0000000..fdd00cf --- /dev/null +++ b/presence.php @@ -0,0 +1,18 @@ +$value) + { + $key = array_search($value, $result); + + } +} + +presence(); +?>