modified init and some debugging
This commit is contained in:
@@ -14,7 +14,7 @@ class rdc_salon_eclairage
|
||||
|
||||
public $delay = 3; // amount of time in $timeunit
|
||||
public $timeUnit = "minute"; // unit of time for delay, second, minute, day, week, month, year
|
||||
public $luminance_min = 80;
|
||||
public $luminance_min = 60;
|
||||
public $luminance_max = 3000;
|
||||
|
||||
|
||||
@@ -60,12 +60,19 @@ class rdc_salon_eclairage
|
||||
private function send($state)
|
||||
{
|
||||
global $devices, $indexDevices;
|
||||
$msg = array("state" => $state);
|
||||
$device = & $indexDevices[RDC_SALON_ECLAIRAGE_PANNEAU];
|
||||
logger(INFO, sprintf(_("publishing message: %s to %s"), $msg, $device->friendlyName));
|
||||
$device->payload = $msg;
|
||||
$device->set(null);
|
||||
setDelay($device, $this->delay, $this->timeUnit, "state", "OFF", true);
|
||||
if ($device->state_l1["value"] != $state)
|
||||
{
|
||||
$msg = array("state" => $state);
|
||||
logger(INFO, sprintf(_("publishing message: %s to %s"), json_encode($msg), $device->friendlyName));
|
||||
$device->payload = $msg;
|
||||
$device->set(null);
|
||||
setDelay($device, $this->delay, $this->timeUnit, "state", "OFF", true);
|
||||
}else
|
||||
{
|
||||
logger(INFO, sprintf(_("not publishing message: %s to %s, already set"), json_encode($msg), $device->friendlyName));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user