1
0

adding command test in apiserver\nsome debugging\nfree sms now running fine

This commit is contained in:
2022-07-10 19:33:19 +02:00
parent 97f8050d29
commit 555abb7c88
14 changed files with 182 additions and 66 deletions

View File

@ -31,16 +31,16 @@ class rdc_wc_eclairage extends hook
if ($targetDevice->properties["state_l2"]["method"] == IDLE)
{
$targetDevice->properties["state_l2"]["method"] = MANUAL;
setDelay($device, $this->delayManual, $this->timeUnit, "state_l2", "OFF", true);
setDelay($targetDevice, $this->delayManual, $this->timeUnit, "state_l2", "OFF", true);
}
}elseif ($value == "OFF")
{
$targetDevice->properties["state_l2"]["method"] = IDLE;
removeEvent($device, "state_l2", "OFF");
removeEvent($targetDevice, "state_l2", "OFF");
}
break;
case "occupancy":
logger(DEBUG, "CASE: occupancy", __FILE__ . ":" . __LINE__);
logger(DEBUG, "CASE: WC occupancy", __FILE__ . ":" . __LINE__);
logger(DEBUG, "method =" . $targetDevice->properties["state_l2"]["method"], __FILE__ . ":" . __LINE__);
if ($value === true and $targetDevice->properties["state_l2"]["method"] == IDLE)
{
@ -50,7 +50,7 @@ class rdc_wc_eclairage extends hook
{
//$targetDevice->properties["state_l2"]["method"] = IDLE;
//$this->send($targetDevice, "OFF");
setDelay($device, $this->delay, $this->timeUnit, "state_l2", "OFF", true, IDLE);
setDelay($targetDevice, $this->delay, $this->timeUnit, "state_l2", "OFF", true, IDLE);
}
}
logger (INFO, sprintf(_("%s: notification received from MQTT from %s => parameter: %s value: %s"), $this->hookName, $device->friendlyName, $property, bool2string($value)), __FILE__ . ":" . __LINE__);