1
0

debugging api and add notify command

This commit is contained in:
2022-02-02 21:18:44 +01:00
parent 85db4e3ff4
commit 18d5b74a96
9 changed files with 100 additions and 43 deletions

View File

@ -9,10 +9,10 @@ class rdc_chambre_eclairage extends hook
public $luminance_min = 60;
public $luminance_max = 3000;
protected $devicelist = array(
"RDC_CHAMBRE_AMBIANCE" => array("state", false), // "ON"/"OFF"
"RDC_CHAMBRE_ECLAIRAGE" => array("state_l1", false), // "ON"/"OFF"
"RDC_CHAMBRE_MVMT" => array("occupancy", false),
"RDC_CHAMBRE_ARMOIRE_GAUCHE" => array("contact", false)
RDC_CHAMBRE_AMBIANCE => array("state", false), // "ON"/"OFF"
RDC_CHAMBRE_ECLAIRAGE => array("state_l1", false), // "ON"/"OFF"
RDC_CHAMBRE_MVMT => array("occupancy", false),
RDC_CHAMBRE_ARMOIRE_GAUCHE => array("contact", false)
);
// callback fonction. Is called with these 3 parameters
@ -26,7 +26,7 @@ class rdc_chambre_eclairage extends hook
if ($property == "occupancy" and $value == "ON")
{
$this->send(RDC_CHAMBRE_AMBIANCE, "ON", "OFF", AUTO);
}elseif ($property == "contact" and $value = true and getValue(RDC_CHAMBRE_ECLAIRAGE) == "OFF")
}elseif ($property == "contact" and $value = true and getValue(RDC_CHAMBRE_ECLAIRAGE, "state_l1") == "OFF")
{
$this->send(RDC_CHAMBRE_ECLAIRAGE, "ON", "OFF", AUTO);
}