1
0

debugging hooks\ncleaning code

This commit is contained in:
2022-01-17 21:01:11 +01:00
parent 4fb5504cdc
commit 11a2253804
7 changed files with 61 additions and 91 deletions

View File

@ -2,8 +2,8 @@
class rdc_salon_eclairage extends hook
{
public $hookName = "rdc_salon_eclairage";
// list of devices we are listening to
// list of devices we are listening to
protected $devicelist = array(
RDC_SALON_MVMT => array("occupancy", false),
RDC_SALON_MVMT2 => array("occupancy", false),
@ -21,9 +21,11 @@ class rdc_salon_eclairage extends hook
public function callBack(&$device, $param, $value)
{
global $devices, $indexDevices;
logger(INFO, _("hook : rdc_salon_eclairage"));
switch($param)
{
case "occupancy":
//print_r($indexDevices[RDC_SALON_LUMINOSITE]);
if ($value == 1 and $indexDevices[RDC_SALON_LUMINOSITE]->illuminance_lux["value"] <= $this->luminance_min)
{
$this->send("ON");
@ -36,7 +38,10 @@ class rdc_salon_eclairage extends hook
}
break;
case "illuminance_lux":
if ($value >= $this->luminance_max) $this->send("OFF");
if ($value >= $this->luminance_max)
{
$this->send("OFF");
}
break;
}
logger (INFO, sprintf(_("%s: notification received from MQTT from %s => parameter: %s value: %s"), $this->hookName, $device->friendlyName, $param, $value));