1
0
moha/hooks/scripts/rdc_chambre_eclairage.php
2022-01-23 09:46:06 +01:00

32 lines
904 B
PHP

<?php
class rdc_chambre_eclairage extends hook
{
public $hookName = "rdc_chambre_eclairage";
public $active = false; //enable/disable hook (true => enabled)
protected $devicelist = array();
// if you need some initialisation when creating the object, uncomment andput your code here.
// If existing, This function is called by __construct
/*protected function init()
{
// Your code here
}
*/
// callback fonction. Is called with these 3 parameters
// $device -> calling device
// $property -> property of the device (given by mqtt)
// $value -> value of the property
public function callBack(&$device, $property, $value)
{
// here your code
logger (INFO,sprintf(_("%s: notification received from MQTT from %s => parameter: %s value: %s"), $this->hookName, $device->friendlyName, $property, $value));
}
}
$hooks["rdc_chambre_eclairage"] = new rdc_chambre_eclairage();
?>