This repository has been archived by the owner on Nov 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathir.h
58 lines (43 loc) · 1.97 KB
/
ir.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
#ifndef IR_H
#define IR_H
#include <QObject>
#include <QString>
#include <QVariant>
#include "../remote-software/sources/integrations/integration.h"
#include "../remote-software/sources/integrations/integrationinterface.h"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// IR FACTORY
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class IR : public QObject, IntegrationInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "YIO.IntegrationInterface" FILE "ir.json")
Q_INTERFACES(IntegrationInterface)
public:
explicit IR() {}
QMap<QObject *, QVariant> create (const QVariantMap& config, QObject *entities, QObject *notifications, QObject* api, QObject *configObj) override;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// IR BASE CLASS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class IRBase : public Integration
{
Q_OBJECT
public:
explicit IRBase();
Q_INVOKABLE void setup (const QVariantMap& config, QObject *entities, QObject *notifications, QObject* api, QObject *configObj);
Q_INVOKABLE void connect ();
Q_INVOKABLE void disconnect ();
signals:
void notify();
public slots:
void sendCommand (const QString& type, const QString& id, const QString& command, const QVariant& param);
private:
void updateEntity (const QString& entity_id, const QVariantMap& attr);
QString findIRCode (const QString& feature, QVariantList& list);
EntitiesInterface* m_entities;
NotificationsInterface* m_notifications;
YioAPIInterface* m_api;
ConfigInterface* m_config;
};
#endif // IR_H