1
0

- lots of debugging

- beginning to add graphical stats
- beginning to add device by type
- added a dashboard "etage"
- begining to add notification to multiple recipients in freemobile hook
This commit is contained in:
2022-03-28 00:40:34 +02:00
parent 80234fc505
commit 0d35b1ff3f
24 changed files with 491 additions and 205 deletions

View File

@ -29,18 +29,14 @@ class rdc_sdb_eclairage extends hook
global $indexDevices;
//var_dump($value);
$deviceTarget = $indexDevices[RDC_SDB_WC_ECLAIRAGE];
logger(DEBUG, sprintf(_("property=%s, value=%s"), $property, $value), __FILE__ . ":" . __LINE__);
logger(DEBUG, "Callback : " . $this->hookName, __FILE__ . ":" . __LINE__);
switch($property)
{
case "occupancy":
logger(DEBUG, _("CASE: occupancy"), __FILE__ . ":" . __LINE__);
if ($value == ON)
if ($value == ON )
{
if (getValue($deviceTarget->ieeeAddress, "state_l1") != "ON")
{
$this->send("ON");
}
//setDelay($indexDevices[RDC_SDB_WC_ECLAIRAGE], $this->delay, $this->timeUnit, "state_l1", "OFF", true);
$this->send("ON");
$device->method = AUTO;
}
break;
@ -48,11 +44,20 @@ class rdc_sdb_eclairage extends hook
logger(DEBUG, _("CASE: state_l1"), __FILE__ . ":" . __LINE__);
if ($value == "ON")
{
setDelay($deviceTarget, $this->delay, $this->timeUnit, "state_l1", "OFF", true);
$device->method = MANUAL;
}elseif ($value = "OFF")
if ($device->method != MANUAL)
{
$delay = $this->delay;
$device->method = AUTO;
}else
{
$delay = $this->delayManual;
$device->method = MANUAL;
}
setDelay($deviceTarget, $delay, $this->timeUnit, "state_l1", "OFF", true);
}elseif ($value == "OFF")
{
removeEvent($deviceTarget, "state_l1", "OFF");
$device->method = null;
}
break;
}