forked from u236/homed-service-zigbee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.h
72 lines (53 loc) · 1.47 KB
/
controller.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef CONTROLLER_H
#define CONTROLLER_H
#define SERVICE_VERSION "3.6.3"
#define UPDATE_AVAILABILITY_INTERVAL 5000
#define UPDATE_PROPERTIES_DELAY 1000
#include "homed.h"
#include "zigbee.h"
class Controller : public HOMEd
{
Q_OBJECT
public:
Controller(const QString &configFile);
enum class Command
{
restartService,
setPermitJoin,
togglePermitJoin,
updateDevice,
removeDevice,
setupDevice,
setupReporting,
bindDevice,
unbindDevice,
addGroup,
removeGroup,
removeAllGroups,
otaUpgrade,
getProperties,
clusterRequest,
globalRequest,
touchLinkScan,
touchLinkReset
};
Q_ENUM(Command)
private:
QTimer *m_avaliabilityTimer, *m_propertiesTimer;
ZigBee *m_zigbee;
QMetaEnum m_commands;
QString m_haStatus;
QMap <QByteArray, qint64> m_lastSeen;
void publishExposes(DeviceObject *device, bool remove = false);
public slots:
void quit(void) override;
private slots:
void mqttConnected(void) override;
void mqttReceived(const QByteArray &message, const QMqttTopicName &topic) override;
void updateAvailability(void);
void updateProperties(void);
void deviceEvent(DeviceObject *device, ZigBee::Event event, const QJsonObject &json);
void endpointUpdated(DeviceObject *device, quint8 endpointId);
void statusUpdated(const QJsonObject &json);
};
#endif