1
0

debug rdc_chambre_eclairage maintenant fonctionnel ... ou pas

This commit is contained in:
Daniel Tartavel 2022-06-21 08:57:10 +02:00
parent 58812c442f
commit b3f7171421

View File

@ -24,20 +24,26 @@ class rdc_chambre_eclairage extends hook
{ {
global $devices, $indexDevices; global $devices, $indexDevices;
logger(DEBUG, sprintf(_("property=%s, value=%s"), $property, $value), __FILE__ . ":" . __LINE__); logger(DEBUG, sprintf(_("property=%s, value=%s"), $property, $value), __FILE__ . ":" . __LINE__);
$lux = $indexDevices[RDC_CHAMBRE_LUMINOSITE]->properties["illuminance_lux"]; $lux = $indexDevices[RDC_CHAMBRE_LUMINOSITE]->properties["illuminance_lux"]["value"];
$targetAmbiance = $indexDevices[RDC_CHAMBRE_AMBIANCE]; $targetAmbiance = $indexDevices[RDC_CHAMBRE_AMBIANCE];
$targetEclairage = $indexDevices[RDC_CHAMBRE_ECLAIRAGE]; $targetEclairage = $indexDevices[RDC_CHAMBRE_ECLAIRAGE];
if ($property == "occupancy") if ($property == "occupancy")
{ {
if ($value == ON and $lux < 150) logger(DEBUG, _("CASE: occupancy"), __FILE__ . ":" . __LINE__);
logger(DEBUG, "lux = " . bool2string($lux) . " luminance_min = " . $this->luminance_min, __FILE__ . ":" . __LINE__);
if ($value === true and $lux < $this->luminance_min)
{ {
logger(DEBUG, _("CASE: occupancy"), __FILE__ . ":" . __LINE__); logger(DEBUG, _("lux < luminance_min"), __FILE__ . ":" . __LINE__);
if ($targetAmbiance->properties["state"]["method"] == MANUAL) if ($targetAmbiance->properties["state"]["method"] == MANUAL)
{ {
logger(DEBUG, _("method => MANUAL"), __FILE__ . ":" . __LINE__);
$method = false; $method = false;
$delayState = false; $delayState = false;
}else }else
{ {
logger(DEBUG, _("method => AUTO"), __FILE__ . ":" . __LINE__);
$method = AUTO; $method = AUTO;
$delayState = "OFF"; $delayState = "OFF";
} }