debuggage
This commit is contained in:
31
hooks/scripts/rdc_chambre_eclairage.php
Normal file
31
hooks/scripts/rdc_chambre_eclairage.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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();
|
||||
?>
|
Reference in New Issue
Block a user