mirror of https://github.com/nymea/nymea.git
Merge PR #540: Provide experience manager access in core instance
commit
c4ea75a809
|
|
@ -1,7 +1,7 @@
|
|||
Source: nymea
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Nymea GmbH <developer@nymea.io>
|
||||
Maintainer: nymea GmbH <developer@nymea.io>
|
||||
Standards-Version: 3.9.7
|
||||
Homepage: https://nymea.io
|
||||
Vcs-Git: https://github.com/nymea/nymea.git
|
||||
|
|
@ -30,6 +30,7 @@ Build-Depends: debhelper (>= 9.0.0),
|
|||
libqt5serialport5-dev,
|
||||
libqt5serialbus5-dev
|
||||
|
||||
|
||||
Package: nymea
|
||||
Architecture: any
|
||||
Section: metapackages
|
||||
|
|
@ -39,13 +40,9 @@ Depends: nymead (= ${binary:Version}),
|
|||
Recommends: qml-module-qtquick2
|
||||
Suggests: nymea-doc
|
||||
Description: An open source IoT server - meta package
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package will install the server and the default plugins.
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server.
|
||||
The server works like a translator for devices, things and services
|
||||
and allows them to interact.
|
||||
|
||||
|
||||
Package: nymead
|
||||
|
|
@ -65,29 +62,18 @@ Recommends: nymea-cli,
|
|||
nymea-zeroconf-plugin-impl,
|
||||
nymea-apikeysprovider-plugin-impl,
|
||||
Description: An open source IoT server - daemon
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package will install the daemon.
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server.
|
||||
The server works like a translator for devices, things and services
|
||||
and allows them to interact.
|
||||
|
||||
|
||||
Package: nymea-data
|
||||
Section: misc
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}
|
||||
Recommends: nymea
|
||||
Description: Optional data for extending functionality in nymea daemon
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package provides the MAC address database for nymead and for the plugins in
|
||||
order to get the manufacturer name for a given MAC address.
|
||||
Recommends: nymead
|
||||
Description: Optional data for extending functionality in nymea daemon - data
|
||||
Provides application data used by nymea:core
|
||||
|
||||
|
||||
Package: nymea-doc
|
||||
|
|
@ -96,14 +82,8 @@ Architecture: all
|
|||
Depends: ${misc:Depends}
|
||||
Recommends: nymea
|
||||
Build-Profiles: <!nodoc>
|
||||
Description: Documentation for the nymea package (on-site) - documentation
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package contains documentation for developing nymea.
|
||||
Description: Documentation for the nymea library - documentation
|
||||
This package contains documentation for developing nymea plugins.
|
||||
|
||||
|
||||
Package: nymea-translations
|
||||
|
|
@ -111,14 +91,32 @@ Section: misc
|
|||
Architecture: all
|
||||
Depends: ${misc:Depends}
|
||||
Recommends: nymea
|
||||
Description: Translation files for nymead and plugins - translations
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package provides the translation files for nymead and for the plugins.
|
||||
Description: Translation files for nymead - translations
|
||||
Translation files for the nymea daemon.
|
||||
|
||||
|
||||
Package: libnymea-tests
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
libnymea-core (= ${binary:Version})
|
||||
Description: nymea-tests library - library
|
||||
Shared resources for nymea-tests.
|
||||
|
||||
|
||||
Package: libnymea-tests-dev
|
||||
Section: libdevel
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
libnymea-tests (= ${binary:Version}),
|
||||
libnymea-core-dev (= ${binary:Version})
|
||||
Description: nymea-tests library - development files
|
||||
Provides the nymea-tests development files for building
|
||||
automated tests.
|
||||
|
||||
|
||||
Package: nymea-tests
|
||||
|
|
@ -127,15 +125,10 @@ Architecture: any
|
|||
Multi-Arch: same
|
||||
Depends: nymea (= ${binary:Version}),
|
||||
${shlibs:Depends},
|
||||
${misc:Depends}
|
||||
Description: Tests and mock plugin for the nymea daemon - tests
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package will install the mock-plugin and the corresponding tests.
|
||||
${misc:Depends},
|
||||
libnymea-tests (= ${binary:Version})
|
||||
Description: nymea automated tests and mock plugin - tests
|
||||
Automated tests and mock plugin for the nymea daemon.
|
||||
|
||||
|
||||
Package: libnymea1
|
||||
|
|
@ -147,14 +140,8 @@ Depends: ${shlibs:Depends},
|
|||
Provides: nymea-update-plugin-api-1,
|
||||
nymea-zeroconf-plugin-api-1,
|
||||
nymea-system-plugin-api-3
|
||||
Description: An open source IoT server - library
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package will install shared libraries for nymea.
|
||||
Description: nymea shared resources - library
|
||||
Shared resources for nymea plugins.
|
||||
|
||||
|
||||
Package: libnymea-dev
|
||||
|
|
@ -169,14 +156,8 @@ Depends: ${shlibs:Depends},
|
|||
Replaces: libnymea1-dev
|
||||
Breaks: libnymea1-dev
|
||||
Provides: libnymea1-dev
|
||||
Description: The main libraries and header files for developing with nymea.
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package will install the development files for nymea.
|
||||
Description: nymea plugin development API library - development files
|
||||
Shared resources for developing nymea plugins.
|
||||
|
||||
|
||||
Package: libnymea-core
|
||||
|
|
@ -201,14 +182,8 @@ Depends: ${shlibs:Depends},
|
|||
iputils-ping,
|
||||
qml-module-qtquick2,
|
||||
dnsutils,
|
||||
Description: An open source IoT server - core library
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package will install shared libraries for nymea core.
|
||||
Description: nymea:core internal - library
|
||||
Internal library for nymea:core.
|
||||
|
||||
|
||||
Package: libnymea-core-dev
|
||||
|
|
@ -219,14 +194,8 @@ Depends: ${shlibs:Depends},
|
|||
${misc:Depends},
|
||||
libnymea-core (= ${binary:Version}),
|
||||
libnymea-dev (= ${binary:Version})
|
||||
Description: The main libraries and header files for developing with nymea core.
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
server works like a translator for devices, things and services and
|
||||
allows them to interact.
|
||||
With the powerful rule engine you are able to connect any device available
|
||||
in the system and create individual scenes and behaviors for your environment.
|
||||
.
|
||||
This package will install the development files for nymea core.
|
||||
Description: nymea:core internal library - development files
|
||||
Development files for the internal nymea:core library.
|
||||
|
||||
|
||||
Package: nymea-dev-tools
|
||||
|
|
@ -238,9 +207,9 @@ Depends: ${shlibs:Depends},
|
|||
qttools5-dev-tools,
|
||||
rsync,
|
||||
Description: Tools for developing nymea plugins.
|
||||
.
|
||||
This package will install the nymea-plugininfocompiler.
|
||||
|
||||
|
||||
Package: nymea-sdk
|
||||
Section: devel
|
||||
Architecture: all
|
||||
|
|
@ -251,5 +220,4 @@ Recommends: nymea-qtcreator-wizards,
|
|||
crossbuilder,
|
||||
Suggests: libnymea-core-dev (= ${binary:Version})
|
||||
Description: The nymea SDK.
|
||||
.
|
||||
Meta-Package for everything required to develop on nymea.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
usr/lib/@DEB_HOST_MULTIARCH@/libnymea-tests.so
|
||||
usr/include/nymea-tests
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig/nymea-tests.pc
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
usr/lib/@DEB_HOST_MULTIARCH@/libnymea-tests.so.1
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/libnymea-tests.so.1.0
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/libnymea-tests.so.1.0.0
|
||||
|
|
@ -1,3 +1,2 @@
|
|||
usr/tests/*
|
||||
usr/bin/nymeatest*
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/libnymea_integrationpluginmock.so
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/libnymea-testlib.so*
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ ExperienceManager::ExperienceManager(ThingManager *thingManager, JsonRPCServer *
|
|||
staticMetaObject.invokeMethod(this, "loadPlugins", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
QList<ExperiencePlugin *> ExperienceManager::plugins() const
|
||||
{
|
||||
return m_plugins;
|
||||
}
|
||||
|
||||
void ExperienceManager::loadPlugins()
|
||||
{
|
||||
foreach (const QString &path, pluginSearchDirs()) {
|
||||
|
|
@ -107,4 +112,12 @@ void ExperienceManager::loadExperiencePlugin(const QString &file)
|
|||
|
||||
}
|
||||
|
||||
void ExperienceManager::loadExperiencePlugin(ExperiencePlugin *experiencePlugin)
|
||||
{
|
||||
qCDebug(dcExperiences()) << "Adding experience plugin:" << experiencePlugin;
|
||||
m_plugins.append(experiencePlugin);
|
||||
experiencePlugin->setParent(this);
|
||||
experiencePlugin->initPlugin(m_thingManager, m_jsonRpcServer);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,24 +45,22 @@ class ExperienceManager : public QObject
|
|||
public:
|
||||
explicit ExperienceManager(ThingManager *thingManager, JsonRPCServer *jsonRpcServer, QObject *parent = nullptr);
|
||||
|
||||
signals:
|
||||
QList<ExperiencePlugin *> plugins() const;
|
||||
|
||||
public slots:
|
||||
// This method is used for testing
|
||||
void loadExperiencePlugin(ExperiencePlugin *experiencePlugin);
|
||||
|
||||
private slots:
|
||||
void loadPlugins();
|
||||
|
||||
private:
|
||||
QStringList pluginSearchDirs() const;
|
||||
|
||||
private:
|
||||
ThingManager *m_thingManager = nullptr;
|
||||
JsonRPCServer *m_jsonRpcServer = nullptr;
|
||||
QList<ExperiencePlugin *> m_plugins;
|
||||
|
||||
QStringList pluginSearchDirs() const;
|
||||
void loadExperiencePlugin(const QString &file);
|
||||
|
||||
private:
|
||||
QList<ExperiencePlugin*> m_plugins;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -665,6 +665,11 @@ ModbusRtuManager *NymeaCore::modbusRtuManager() const
|
|||
return m_modbusRtuManager;
|
||||
}
|
||||
|
||||
ExperienceManager *NymeaCore::experienceManager() const
|
||||
{
|
||||
return m_experienceManager;
|
||||
}
|
||||
|
||||
void NymeaCore::onEventTriggered(const Event &event)
|
||||
{
|
||||
emit eventTriggered(event);
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ public:
|
|||
Platform *platform() const;
|
||||
ZigbeeManager *zigbeeManager() const;
|
||||
ModbusRtuManager *modbusRtuManager() const;
|
||||
ExperienceManager *experienceManager() const;
|
||||
|
||||
static QStringList getAvailableLanguages();
|
||||
static QStringList loggingFilters();
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ INCLUDEPATH += $$top_srcdir/libnymea \
|
|||
|
||||
LIBS += -L$$top_builddir/libnymea/ -lnymea \
|
||||
-L$$top_builddir/libnymea-core/ -lnymea-core \
|
||||
-L$$top_builddir/tests/testlib/ -lnymea-testlib \
|
||||
-L$$top_builddir/tests/testlib/ -lnymea-tests \
|
||||
-L$$top_builddir/plugins/mock/ \
|
||||
-lssl -lcrypto -lnymea-remoteproxyclient
|
||||
|
||||
target.path = /usr/tests
|
||||
target.path = $$[QT_INSTALL_PREFIX]/bin
|
||||
INSTALLS += target
|
||||
|
||||
test.commands = LD_LIBRARY_PATH=../../../libnymea:../../../libnymea-core/:../../testlib/ make check TESTRUNNER=\"dbus-test-runner --bus-type=both --task\"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
TARGET = testconfigurations
|
||||
TARGET = nymeatestconfigurations
|
||||
|
||||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
||||
TARGET = testintegrations
|
||||
TARGET = nymeatestintegrations
|
||||
SOURCES += testintegrations.cpp
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
||||
TARGET = testioconnections
|
||||
TARGET = nymeatestioconnections
|
||||
SOURCES += testioconnections.cpp
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
||||
TARGET = testjsonrpc
|
||||
TARGET = nymeatestjsonrpc
|
||||
SOURCES += testjsonrpc.cpp \
|
||||
../../utils/pushbuttonagent.cpp
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
||||
TARGET = testlogging
|
||||
TARGET = nymeatestlogging
|
||||
SOURCES += testlogging.cpp
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
||||
TARGET = testloggingdirect
|
||||
TARGET = nymeatestloggingdirect
|
||||
SOURCES += testloggingdirect.cpp
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@ include(../../../nymea.pri)
|
|||
include(../autotests.pri)
|
||||
|
||||
RESOURCES += loggingloading.qrc
|
||||
TARGET = loggingloading
|
||||
TARGET = nymeatestloggingloading
|
||||
SOURCES += testloggingloading.cpp
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
TARGET = testmacaddress
|
||||
TARGET = nymeatestmacaddress
|
||||
|
||||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@ include(../autotests.pri)
|
|||
QT += xml
|
||||
PKGCONFIG += nymea-mqtt
|
||||
|
||||
TARGET = mqttbroker
|
||||
TARGET = nymeatestmqttbroker
|
||||
SOURCES += testmqttbroker.cpp
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
TARGET = testactions
|
||||
TARGET = nymeatestplugins
|
||||
|
||||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
TARGET = testpythonplugins
|
||||
TARGET = nymeatestpythonplugins
|
||||
|
||||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
||||
TARGET = rules
|
||||
TARGET = nymeatestrules
|
||||
SOURCES += testrules.cpp
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
||||
TARGET = scripts
|
||||
TARGET = nymeatestscripts
|
||||
SOURCES += testscripts.cpp \
|
||||
testhelper.cpp
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
||||
TARGET = testtags
|
||||
TARGET = nymeatesttags
|
||||
SOURCES += testtags.cpp
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
TARGET = testtimemanager
|
||||
TARGET = nymeatesttimemanager
|
||||
|
||||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@ include(../../../nymea.pri)
|
|||
include(../autotests.pri)
|
||||
|
||||
RESOURCES += userloading.qrc
|
||||
TARGET = userloading
|
||||
TARGET = nymeatestuserloading
|
||||
SOURCES += testuserloading.cpp
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
||||
TARGET = testusermanager
|
||||
TARGET = nymeatestusermanager
|
||||
|
||||
HEADERS += ../../utils/pushbuttonagent.h
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
TARGET = testversioning
|
||||
TARGET = nymeatestversioning
|
||||
|
||||
include(../../../nymea.pri)
|
||||
include(../autotests.pri)
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@ include(../autotests.pri)
|
|||
|
||||
QT += xml
|
||||
|
||||
TARGET = webserver
|
||||
TARGET = nymeatestwebserver
|
||||
SOURCES += testwebserver.cpp
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ include(../autotests.pri)
|
|||
|
||||
QT += websockets
|
||||
|
||||
TARGET = websocketserver
|
||||
TARGET = nymeatestwebsocketserver
|
||||
SOURCES += testwebsocketserver.cpp
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
TEMPLATE = lib
|
||||
TARGET = nymea-testlib
|
||||
TARGET = nymea-tests
|
||||
|
||||
include(../../nymea.pri)
|
||||
|
||||
|
|
@ -28,3 +28,22 @@ SOURCES += nymeatestbase.cpp
|
|||
|
||||
target.path = $$[QT_INSTALL_LIBS]
|
||||
INSTALLS += target
|
||||
|
||||
# install header file with relative subdirectory
|
||||
for(header, HEADERS) {
|
||||
path = $$[QT_INSTALL_PREFIX]/include/nymea-tests/$${dirname(header)}
|
||||
eval(headers_$${path}.files += $${header})
|
||||
eval(headers_$${path}.path = $${path})
|
||||
eval(INSTALLS *= headers_$${path})
|
||||
}
|
||||
|
||||
# Create pkgconfig file
|
||||
CONFIG += create_pc create_prl no_install_prl
|
||||
QMAKE_PKGCONFIG_NAME = libnymea-tests
|
||||
QMAKE_PKGCONFIG_DESCRIPTION = nymea-tests development library
|
||||
QMAKE_PKGCONFIG_PREFIX = $$[QT_INSTALL_PREFIX]
|
||||
QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_PREFIX]/include/nymea-tests/
|
||||
QMAKE_PKGCONFIG_LIBDIR = $$target.path
|
||||
QMAKE_PKGCONFIG_VERSION = $$NYMEA_VERSION_STRING
|
||||
QMAKE_PKGCONFIG_FILE = nymea-tests
|
||||
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
|
||||
|
|
|
|||
Loading…
Reference in New Issue