fixed plugin names

This commit is contained in:
Simon Stürz 2014-01-02 16:01:16 +01:00
parent 8030192caf
commit 86ff25258e
9 changed files with 49 additions and 49 deletions

View File

@ -1,4 +1,4 @@
#include "rfremotemumbi.h" #include "devicepluginelro.h"
#include "device.h" #include "device.h"
#include "devicemanager.h" #include "devicemanager.h"
@ -7,26 +7,26 @@
#include <QDebug> #include <QDebug>
#include <QStringList> #include <QStringList>
QUuid mumbiRemote = QUuid("d85c1ef4-197c-4053-8e40-707aa671d302"); QUuid elroRemote = QUuid("d85c1ef4-197c-4053-8e40-707aa671d302");
QUuid mumbiRfRemoteMumbi = QUuid("308ae6e6-38b3-4b3a-a513-3199da2764f8"); QUuid elroDevicePlugin = QUuid("308ae6e6-38b3-4b3a-a513-3199da2764f8");
RfRemoteMumbi::RfRemoteMumbi() DevicePluginElro::DevicePluginElro()
{ {
} }
void RfRemoteMumbi::init() void DevicePluginElro::init()
{ {
connect(deviceManager()->radio433(), &Radio433::dataReceived, this, &RfRemoteMumbi::dataReceived); connect(deviceManager()->radio433(), &Radio433::dataReceived, this, &DevicePluginElro::dataReceived);
} }
QList<DeviceClass> RfRemoteMumbi::supportedDevices() const QList<DeviceClass> DevicePluginElro::supportedDevices() const
{ {
// TODO: load list from config with static uuid // TODO: load list from config with static uuid
QList<DeviceClass> ret; QList<DeviceClass> ret;
// Remote // Remote
DeviceClass deviceClassRfRemoteMumbi(pluginId(), mumbiRemote); DeviceClass deviceClassDevicePluginElro(pluginId(), elroRemote);
deviceClassRfRemoteMumbi.setName("Mumbi Remote"); deviceClassDevicePluginElro.setName("Elro Remote");
QVariantList deviceParamsRemote; QVariantList deviceParamsRemote;
QVariantMap channelParam; QVariantMap channelParam;
@ -46,7 +46,7 @@ QList<DeviceClass> RfRemoteMumbi::supportedDevices() const
channelParam.insert("type", "bool"); channelParam.insert("type", "bool");
deviceParamsRemote.append(channelParam); deviceParamsRemote.append(channelParam);
deviceClassRfRemoteMumbi.setParams(deviceParamsRemote); deviceClassDevicePluginElro.setParams(deviceParamsRemote);
QList<TriggerType> buttonTriggers; QList<TriggerType> buttonTriggers;
@ -81,12 +81,12 @@ QList<DeviceClass> RfRemoteMumbi::supportedDevices() const
buttonETrigger.setParameters(paramsRemote); buttonETrigger.setParameters(paramsRemote);
buttonTriggers.append(buttonETrigger); buttonTriggers.append(buttonETrigger);
deviceClassRfRemoteMumbi.setTriggers(buttonTriggers); deviceClassDevicePluginElro.setTriggers(buttonTriggers);
ret.append(deviceClassRfRemoteMumbi); ret.append(deviceClassDevicePluginElro);
// Switch // Switch
DeviceClass deviceClassRfSwitchMumbi(pluginId(), mumbiRfRemoteMumbi); DeviceClass deviceClassRfSwitchMumbi(pluginId(), elroDevicePlugin);
deviceClassRfSwitchMumbi.setName("Mumbi Power Switch"); deviceClassRfSwitchMumbi.setName("Elro Power Switch");
QVariantList deviceParamsSwitch; QVariantList deviceParamsSwitch;
QVariantMap paramSwitch; QVariantMap paramSwitch;
@ -140,17 +140,17 @@ QList<DeviceClass> RfRemoteMumbi::supportedDevices() const
return ret; return ret;
} }
QString RfRemoteMumbi::pluginName() const QString DevicePluginElro::pluginName() const
{ {
return QStringLiteral("RF Remote Mumbi"); return QStringLiteral("Elro");
} }
QUuid RfRemoteMumbi::pluginId() const QUuid DevicePluginElro::pluginId() const
{ {
return QUuid("2b267f81-d9ae-4f4f-89a0-7386b547cfd3"); return QUuid("2b267f81-d9ae-4f4f-89a0-7386b547cfd3");
} }
void RfRemoteMumbi::executeAction(Device *device, const Action &action) void DevicePluginElro::executeAction(Device *device, const Action &action)
{ {
QList<int> rawData; QList<int> rawData;
@ -244,7 +244,7 @@ void RfRemoteMumbi::executeAction(Device *device, const Action &action)
deviceManager()->radio433()->sendData(rawData); deviceManager()->radio433()->sendData(rawData);
} }
void RfRemoteMumbi::dataReceived(QList<int> rawData) void DevicePluginElro::dataReceived(QList<int> rawData)
{ {
// filter right here a wrong signal length // filter right here a wrong signal length
if(rawData.length() != 49){ if(rawData.length() != 49){
@ -332,7 +332,7 @@ void RfRemoteMumbi::dataReceived(QList<int> rawData)
} }
Device *device = 0; Device *device = 0;
QList<Device*> deviceList = deviceManager()->findConfiguredDevices(mumbiRemote); QList<Device*> deviceList = deviceManager()->findConfiguredDevices(elroRemote);
foreach (Device *dev, deviceList) { foreach (Device *dev, deviceList) {
if (dev->params().contains("channel1") && dev->params().value("channel1").toBool() == group.at(0) && if (dev->params().contains("channel1") && dev->params().value("channel1").toBool() == group.at(0) &&
dev->params().contains("channel2") && dev->params().value("channel2").toBool() == group.at(1) && dev->params().contains("channel2") && dev->params().value("channel2").toBool() == group.at(1) &&
@ -346,7 +346,7 @@ void RfRemoteMumbi::dataReceived(QList<int> rawData)
} }
} }
if (!device) { if (!device) {
qWarning() << "couldn't find any configured device for mumbi:" << binCode.left(10) ; qWarning() << "couldn't find any configured device for elro:" << binCode.left(10) ;
return; return;
} }

View File

@ -1,17 +1,17 @@
#ifndef RFREMOTEMUMBI_H #ifndef DEVICEPLUGINELRO_H
#define RFREMOTEMUMBI_H #define DEVICEPLUGINELRO_H
#include "deviceplugin.h" #include "deviceplugin.h"
class RfRemoteMumbi : public DevicePlugin class DevicePluginElro : public DevicePlugin
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "org.hiveyourhome.DevicePlugin" FILE "rfremotemumbi.json") Q_PLUGIN_METADATA(IID "org.hiveyourhome.DevicePlugin" FILE "devicepluginelro.json")
Q_INTERFACES(DevicePlugin) Q_INTERFACES(DevicePlugin)
public: public:
explicit RfRemoteMumbi(); explicit DevicePluginElro();
void init() override; void init() override;
QList<DeviceClass> supportedDevices() const override; QList<DeviceClass> supportedDevices() const override;
@ -26,4 +26,4 @@ private slots:
void dataReceived(QList<int> rawData); void dataReceived(QList<int> rawData);
}; };
#endif // RFREMOTEMUMBI_H #endif // DEVICEPLUGINELRO_H

View File

@ -1,15 +1,15 @@
TEMPLATE = lib TEMPLATE = lib
CONFIG += plugin static CONFIG += plugin static
TARGET = $$qtLibraryTarget(hive_rfremotemumbi) TARGET = $$qtLibraryTarget(hive_devicepluginelro)
INCLUDEPATH += ../../../libhive INCLUDEPATH += ../../../libhive
LIBS += -L../../../libhive -lhive LIBS += -L../../../libhive -lhive
SOURCES += \ SOURCES += \
rfremotemumbi.cpp devicepluginelro.cpp
HEADERS += \ HEADERS += \
rfremotemumbi.h devicepluginelro.h

View File

@ -1,4 +1,4 @@
#include "rfremoteintertechno.h" #include "devicepluginintertechno.h"
#include "device.h" #include "device.h"
#include "devicemanager.h" #include "devicemanager.h"
@ -9,16 +9,16 @@
QUuid intertechnoRemote = QUuid("ab73ad2f-6594-45a3-9063-8f72d365c5e5"); QUuid intertechnoRemote = QUuid("ab73ad2f-6594-45a3-9063-8f72d365c5e5");
RfRemoteIntertechno::RfRemoteIntertechno() DevicePluginIntertechno::DevicePluginIntertechno()
{ {
} }
void RfRemoteIntertechno::init() void DevicePluginIntertechno::init()
{ {
connect(deviceManager()->radio433(), &Radio433::dataReceived, this, &RfRemoteIntertechno::dataReceived); connect(deviceManager()->radio433(), &Radio433::dataReceived, this, &DevicePluginIntertechno::dataReceived);
} }
QList<DeviceClass> RfRemoteIntertechno::supportedDevices() const QList<DeviceClass> DevicePluginIntertechno::supportedDevices() const
{ {
QList<DeviceClass> ret; QList<DeviceClass> ret;
@ -76,22 +76,22 @@ QList<DeviceClass> RfRemoteIntertechno::supportedDevices() const
return ret; return ret;
} }
QString RfRemoteIntertechno::pluginName() const QString DevicePluginIntertechno::pluginName() const
{ {
return "RF Remote Intertechno"; return "RF Remote Intertechno";
} }
QUuid RfRemoteIntertechno::pluginId() const QUuid DevicePluginIntertechno::pluginId() const
{ {
return QUuid("e998d934-0397-42c1-ad63-9141bcac8563"); return QUuid("e998d934-0397-42c1-ad63-9141bcac8563");
} }
void RfRemoteIntertechno::executeAction(Device *device, const Action &action) void DevicePluginIntertechno::executeAction(Device *device, const Action &action)
{ {
} }
void RfRemoteIntertechno::dataReceived(QList<int> rawData) void DevicePluginIntertechno::dataReceived(QList<int> rawData)
{ {
// filter right here a wrong signal length // filter right here a wrong signal length
if(rawData.length() != 49){ if(rawData.length() != 49){

View File

@ -1,17 +1,17 @@
#ifndef RFREMOTEINTERTECHNO_H #ifndef DEVICEPLUGININTERTECHNO_H
#define RFREMOTEINTERTECHNO_H #define DEVICEPLUGININTERTECHNO_H
#include "deviceplugin.h" #include "deviceplugin.h"
class RfRemoteIntertechno : public DevicePlugin class DevicePluginIntertechno : public DevicePlugin
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "org.hiveyourhome.DevicePlugin" FILE "rfremoteintertechno.json") Q_PLUGIN_METADATA(IID "org.hiveyourhome.DevicePlugin" FILE "devicepluginintertechno.json")
Q_INTERFACES(DevicePlugin) Q_INTERFACES(DevicePlugin)
public: public:
explicit RfRemoteIntertechno(); explicit DevicePluginIntertechno();
void init() override; void init() override;
QList<DeviceClass> supportedDevices() const override; QList<DeviceClass> supportedDevices() const override;
@ -26,4 +26,4 @@ private slots:
void dataReceived(QList<int> rawData); void dataReceived(QList<int> rawData);
}; };
#endif // RFREMOTEINTERTECHNO_H #endif // DEVICEPLUGININTERTECHNO_H

View File

@ -1,15 +1,15 @@
TEMPLATE = lib TEMPLATE = lib
CONFIG += plugin static CONFIG += plugin static
TARGET = $$qtLibraryTarget(hive_rfremoteintertechno) TARGET = $$qtLibraryTarget(hive_devicepluginintertechno)
INCLUDEPATH += ../../../libhive INCLUDEPATH += ../../../libhive
LIBS += -L../../../libhive -lhive LIBS += -L../../../libhive -lhive
SOURCES += \ SOURCES += \
rfremoteintertechno.cpp devicepluginintertechno.cpp
HEADERS += \ HEADERS += \
rfremoteintertechno.h devicepluginintertechno.h

View File

@ -1,3 +1,3 @@
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS += rfremotemumbi rfremoteintertechno SUBDIRS += devicepluginelro devicepluginintertechno