Add experience mode plugins
This commit is contained in:
parent
5e3bc2acbd
commit
f1ca2a5b86
11
libnymea-core/experiences/experiencemanager.cpp
Normal file
11
libnymea-core/experiences/experiencemanager.cpp
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include "experiencemanager.h"
|
||||||
|
|
||||||
|
#include "jsonrpc/jsonrpcserver.h"
|
||||||
|
namespace nymeaserver {
|
||||||
|
ExperienceManager::ExperienceManager(JsonRPCServer *jsonRpcServer, QObject *parent) : QObject(parent)
|
||||||
|
{
|
||||||
|
// jsonRpcServer->registerHandler();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
22
libnymea-core/experiences/experiencemanager.h
Normal file
22
libnymea-core/experiences/experiencemanager.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef EXPERIENCEMANAGER_H
|
||||||
|
#define EXPERIENCEMANAGER_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
namespace nymeaserver {
|
||||||
|
|
||||||
|
class JsonRPCServer;
|
||||||
|
|
||||||
|
class ExperienceManager : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit ExperienceManager(JsonRPCServer *jsonRpcServer, QObject *parent = nullptr);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif // EXPERIENCEMANAGER_H
|
||||||
@ -71,6 +71,8 @@ public:
|
|||||||
void registerTransportInterface(TransportInterface *interface, bool authenticationRequired);
|
void registerTransportInterface(TransportInterface *interface, bool authenticationRequired);
|
||||||
void unregisterTransportInterface(TransportInterface *interface);
|
void unregisterTransportInterface(TransportInterface *interface);
|
||||||
|
|
||||||
|
void registerHandler(JsonHandler *handler);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QHash<QString, JsonHandler *> handlers() const;
|
QHash<QString, JsonHandler *> handlers() const;
|
||||||
|
|
||||||
@ -117,8 +119,6 @@ private:
|
|||||||
|
|
||||||
int m_notificationId;
|
int m_notificationId;
|
||||||
|
|
||||||
void registerHandler(JsonHandler *handler);
|
|
||||||
|
|
||||||
QString formatAssertion(const QString &targetNamespace, const QString &method, QMetaMethod::MethodType methodType, JsonHandler *handler, const QVariantMap &data) const;
|
QString formatAssertion(const QString &targetNamespace, const QString &method, QMetaMethod::MethodType methodType, JsonHandler *handler, const QVariantMap &data) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,7 @@ RESOURCES += $$top_srcdir/icons.qrc \
|
|||||||
HEADERS += nymeacore.h \
|
HEADERS += nymeacore.h \
|
||||||
devices/devicemanagerimplementation.h \
|
devices/devicemanagerimplementation.h \
|
||||||
devices/translator.h \
|
devices/translator.h \
|
||||||
|
experiences/experiencemanager.h \
|
||||||
ruleengine/ruleengine.h \
|
ruleengine/ruleengine.h \
|
||||||
ruleengine/rule.h \
|
ruleengine/rule.h \
|
||||||
ruleengine/stateevaluator.h \
|
ruleengine/stateevaluator.h \
|
||||||
@ -95,6 +96,7 @@ HEADERS += nymeacore.h \
|
|||||||
SOURCES += nymeacore.cpp \
|
SOURCES += nymeacore.cpp \
|
||||||
devices/devicemanagerimplementation.cpp \
|
devices/devicemanagerimplementation.cpp \
|
||||||
devices/translator.cpp \
|
devices/translator.cpp \
|
||||||
|
experiences/experiencemanager.cpp \
|
||||||
ruleengine/ruleengine.cpp \
|
ruleengine/ruleengine.cpp \
|
||||||
ruleengine/rule.cpp \
|
ruleengine/rule.cpp \
|
||||||
ruleengine/stateevaluator.cpp \
|
ruleengine/stateevaluator.cpp \
|
||||||
|
|||||||
@ -171,6 +171,9 @@ void NymeaCore::init() {
|
|||||||
qCDebug(dcApplication) << "Creating Cloud Manager";
|
qCDebug(dcApplication) << "Creating Cloud Manager";
|
||||||
m_cloudManager = new CloudManager(m_configuration, m_networkManager, this);
|
m_cloudManager = new CloudManager(m_configuration, m_networkManager, this);
|
||||||
|
|
||||||
|
qCDebug(dcApplication()) << "Loading experiences";
|
||||||
|
|
||||||
|
|
||||||
CloudNotifications *cloudNotifications = m_cloudManager->createNotificationsPlugin();
|
CloudNotifications *cloudNotifications = m_cloudManager->createNotificationsPlugin();
|
||||||
m_deviceManager->registerStaticPlugin(cloudNotifications, cloudNotifications->metaData());
|
m_deviceManager->registerStaticPlugin(cloudNotifications, cloudNotifications->metaData());
|
||||||
|
|
||||||
|
|||||||
6
libnymea/experiences/experienceplugin.cpp
Normal file
6
libnymea/experiences/experienceplugin.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "experienceplugin.h"
|
||||||
|
|
||||||
|
ExperiencePlugin::ExperiencePlugin(QObject *parent) : JsonHandler(parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
18
libnymea/experiences/experienceplugin.h
Normal file
18
libnymea/experiences/experienceplugin.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef EXPERIENCEPLUGIN_H
|
||||||
|
#define EXPERIENCEPLUGIN_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include "jsonrpc/jsonhandler.h"
|
||||||
|
|
||||||
|
class ExperiencePlugin : public JsonHandler
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit ExperiencePlugin(QObject *parent = nullptr);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // EXPERIENCEPLUGIN_H
|
||||||
@ -26,6 +26,7 @@ HEADERS += \
|
|||||||
devices/browseresult.h \
|
devices/browseresult.h \
|
||||||
jsonrpc/jsonhandler.h \
|
jsonrpc/jsonhandler.h \
|
||||||
jsonrpc/jsonreply.h \
|
jsonrpc/jsonreply.h \
|
||||||
|
experiences/experienceplugin.h \
|
||||||
libnymea.h \
|
libnymea.h \
|
||||||
platform/package.h \
|
platform/package.h \
|
||||||
platform/repository.h \
|
platform/repository.h \
|
||||||
@ -102,6 +103,7 @@ SOURCES += \
|
|||||||
devices/browseresult.cpp \
|
devices/browseresult.cpp \
|
||||||
jsonrpc/jsonhandler.cpp \
|
jsonrpc/jsonhandler.cpp \
|
||||||
jsonrpc/jsonreply.cpp \
|
jsonrpc/jsonreply.cpp \
|
||||||
|
experiences/experienceplugin.cpp \
|
||||||
loggingcategories.cpp \
|
loggingcategories.cpp \
|
||||||
nymeasettings.cpp \
|
nymeasettings.cpp \
|
||||||
platform/package.cpp \
|
platform/package.cpp \
|
||||||
|
|||||||
Reference in New Issue
Block a user