1
0
moha/class/main.php

72 lines
1.2 KiB
PHP
Raw Normal View History

2022-01-02 13:07:02 +01:00
<?php
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;
}
class device
{
public $method; //auto or manual
public $topic;
public $device;
public $ieeeAddress;
public $groupID;
public $friendlyName;
public $powerSource;
public $description;
public $functions;
public $payload;
2022-01-06 13:03:26 +01:00
public $availability = array();
2022-01-02 13:07:02 +01:00
public function set($event)
{
publish($this->topic . "/" . $this->friendlyName, $this->payload, "set", $event);
2022-01-02 13:07:02 +01:00
}
public function get()
{
publish($this->topic . "/" . $this->friendlyNames, $this->payload, "get", $event);
2022-01-02 13:07:02 +01:00
}
}
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;
}
?>