32 lines
904 B
PHP
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();
|
|
?>
|