debug\ncode optimization
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
class rdc_salon_eclairage extends hook
|
||||
{
|
||||
public $hookName = "rdc_salon_eclairage";
|
||||
|
||||
public $active = true;
|
||||
// list of devices we are listening to
|
||||
protected $devicelist = array(
|
||||
RDC_SALON_MVMT => array("occupancy", false),
|
||||
@@ -44,19 +44,19 @@ class rdc_salon_eclairage extends hook
|
||||
}
|
||||
break;
|
||||
}
|
||||
logger (INFO, sprintf(_("%s: notification received from MQTT from %s => parameter: %s value: %s"), $this->hookName, $device->friendlyName, $param, $value));
|
||||
logger (INFO, sprintf(_("%s: notification received from MQTT from %s => parameter: %s value: %s"), $this->hookName, $device->friendlyName, $param, bool2string($value)));
|
||||
}
|
||||
|
||||
private function send($state)
|
||||
{
|
||||
global $devices, $indexDevices;
|
||||
$device = & $indexDevices[RDC_SALON_ECLAIRAGE_PANNEAU];
|
||||
$msg = array("state" => $state);
|
||||
if ($device->state["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);
|
||||
$device->set();
|
||||
setDelay($device, $this->delay, $this->timeUnit, "state", "OFF", true);
|
||||
}else
|
||||
{
|
||||
|
Reference in New Issue
Block a user