1
0
moha/class/main.php
2022-01-28 23:05:58 +01:00

83 lines
1.5 KiB
PHP

<?php
logger(DEBUG, _("Including class main.php"), __FILE__ . ":" . __LINE__);
class Message
{
public $id;
public $state = false;
public $msg;
}
class topic {
public $mid;
public $status;
public $info;
public $devices;
public $groups;
public $extensions;
public $config;
public $callback;
}
class device
{
public $method; //0 = auto or 1 = manual
public $topic;
public $device;
public $ieeeAddress;
public $groupID;
public $friendlyName;
public $powerSource;
public $description;
public $functions;
public $payload;
public $availability;
public $toConfirm;
public $triggerDevice;
public function __construct()
{
$this->availability = array("value" => null, "functions" => array());
}
public function set($method=0) //, $event = null)
{
$this->method = $method;
publish($this->topic . "/" . $this->friendlyName, $this->payload, "set"); //, $event);
}
public function get()
{
publish($this->topic . "/" . $this->friendlyNames, $this->payload, "get"); //, $event);
}
}
class ranges
{
public $start; //datetime
public $end; //datetime
}
class event
{
public $ieeeAddress;
public $topic;
public $param;
public $value;
public $device;
public $published;
public $dateTimeEvent; // datetime : next occurence for recurrent event
public $startDatetime;
public $stopDatetime;
public $recurrenceInterval; // interval : for recurrent event
public $exceptionInterval; // array of object ranges
}
class interval
{
public $startDate;
public $endDate;
}
?>