1
0

hooks are now classes and devices scan exposes to add properties

This commit is contained in:
2021-12-31 23:09:58 +01:00
parent 57390d099b
commit f2f8e27c89
5 changed files with 111 additions and 28 deletions

View File

@@ -8,8 +8,8 @@ function checkEvents()
{
if (!empty($event->dateTimeEvent) and $event->dateTimeEvent <= now())
{
//echo "---->sending command" . EOL;
publish($devices[$event->topic][$indexDevices[$event->ieeeAddress]], array($event->param => $event->value), "set", $key);
echo "---->sending command" . EOL;
publish($event->device, array($event->param => $event->value), "set", $key);
//$event->published = now();
//echo "#################################\nUnsetting event $key \n###########################" . EOL;
unset($events[$key]);
@@ -62,10 +62,13 @@ function setDelay(&$device, $delay, $unit="sec", $param, $value, $replace=false)
$events[$key]->topic = $device->topic;
$events[$key]->param = $param;
$events[$key]->value = $value;
$events[$key]->device = & $device;
echo "new event";
}
function searchEvent($device, $param , $value)
function searchEvent($device, $param , $value): int
{
global $events;
echo "searching event" . EOL;