fixed plugin names
This commit is contained in:
parent
8030192caf
commit
86ff25258e
@ -1,4 +1,4 @@
|
||||
#include "rfremotemumbi.h"
|
||||
#include "devicepluginelro.h"
|
||||
|
||||
#include "device.h"
|
||||
#include "devicemanager.h"
|
||||
@ -7,26 +7,26 @@
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
|
||||
QUuid mumbiRemote = QUuid("d85c1ef4-197c-4053-8e40-707aa671d302");
|
||||
QUuid mumbiRfRemoteMumbi = QUuid("308ae6e6-38b3-4b3a-a513-3199da2764f8");
|
||||
QUuid elroRemote = QUuid("d85c1ef4-197c-4053-8e40-707aa671d302");
|
||||
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
|
||||
QList<DeviceClass> ret;
|
||||
|
||||
// Remote
|
||||
DeviceClass deviceClassRfRemoteMumbi(pluginId(), mumbiRemote);
|
||||
deviceClassRfRemoteMumbi.setName("Mumbi Remote");
|
||||
DeviceClass deviceClassDevicePluginElro(pluginId(), elroRemote);
|
||||
deviceClassDevicePluginElro.setName("Elro Remote");
|
||||
|
||||
QVariantList deviceParamsRemote;
|
||||
QVariantMap channelParam;
|
||||
@ -46,7 +46,7 @@ QList<DeviceClass> RfRemoteMumbi::supportedDevices() const
|
||||
channelParam.insert("type", "bool");
|
||||
deviceParamsRemote.append(channelParam);
|
||||
|
||||
deviceClassRfRemoteMumbi.setParams(deviceParamsRemote);
|
||||
deviceClassDevicePluginElro.setParams(deviceParamsRemote);
|
||||
|
||||
QList<TriggerType> buttonTriggers;
|
||||
|
||||
@ -81,12 +81,12 @@ QList<DeviceClass> RfRemoteMumbi::supportedDevices() const
|
||||
buttonETrigger.setParameters(paramsRemote);
|
||||
buttonTriggers.append(buttonETrigger);
|
||||
|
||||
deviceClassRfRemoteMumbi.setTriggers(buttonTriggers);
|
||||
ret.append(deviceClassRfRemoteMumbi);
|
||||
deviceClassDevicePluginElro.setTriggers(buttonTriggers);
|
||||
ret.append(deviceClassDevicePluginElro);
|
||||
|
||||
// Switch
|
||||
DeviceClass deviceClassRfSwitchMumbi(pluginId(), mumbiRfRemoteMumbi);
|
||||
deviceClassRfSwitchMumbi.setName("Mumbi Power Switch");
|
||||
DeviceClass deviceClassRfSwitchMumbi(pluginId(), elroDevicePlugin);
|
||||
deviceClassRfSwitchMumbi.setName("Elro Power Switch");
|
||||
|
||||
QVariantList deviceParamsSwitch;
|
||||
QVariantMap paramSwitch;
|
||||
@ -140,17 +140,17 @@ QList<DeviceClass> RfRemoteMumbi::supportedDevices() const
|
||||
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");
|
||||
}
|
||||
|
||||
void RfRemoteMumbi::executeAction(Device *device, const Action &action)
|
||||
void DevicePluginElro::executeAction(Device *device, const Action &action)
|
||||
{
|
||||
|
||||
QList<int> rawData;
|
||||
@ -244,7 +244,7 @@ void RfRemoteMumbi::executeAction(Device *device, const Action &action)
|
||||
deviceManager()->radio433()->sendData(rawData);
|
||||
}
|
||||
|
||||
void RfRemoteMumbi::dataReceived(QList<int> rawData)
|
||||
void DevicePluginElro::dataReceived(QList<int> rawData)
|
||||
{
|
||||
// filter right here a wrong signal length
|
||||
if(rawData.length() != 49){
|
||||
@ -332,7 +332,7 @@ void RfRemoteMumbi::dataReceived(QList<int> rawData)
|
||||
}
|
||||
|
||||
Device *device = 0;
|
||||
QList<Device*> deviceList = deviceManager()->findConfiguredDevices(mumbiRemote);
|
||||
QList<Device*> deviceList = deviceManager()->findConfiguredDevices(elroRemote);
|
||||
foreach (Device *dev, deviceList) {
|
||||
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) &&
|
||||
@ -346,7 +346,7 @@ void RfRemoteMumbi::dataReceived(QList<int> rawData)
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
#ifndef RFREMOTEMUMBI_H
|
||||
#define RFREMOTEMUMBI_H
|
||||
#ifndef DEVICEPLUGINELRO_H
|
||||
#define DEVICEPLUGINELRO_H
|
||||
|
||||
#include "deviceplugin.h"
|
||||
|
||||
class RfRemoteMumbi : public DevicePlugin
|
||||
class DevicePluginElro : public DevicePlugin
|
||||
{
|
||||
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)
|
||||
|
||||
public:
|
||||
explicit RfRemoteMumbi();
|
||||
explicit DevicePluginElro();
|
||||
|
||||
void init() override;
|
||||
QList<DeviceClass> supportedDevices() const override;
|
||||
@ -26,4 +26,4 @@ private slots:
|
||||
void dataReceived(QList<int> rawData);
|
||||
};
|
||||
|
||||
#endif // RFREMOTEMUMBI_H
|
||||
#endif // DEVICEPLUGINELRO_H
|
||||
@ -1,15 +1,15 @@
|
||||
TEMPLATE = lib
|
||||
CONFIG += plugin static
|
||||
|
||||
TARGET = $$qtLibraryTarget(hive_rfremotemumbi)
|
||||
TARGET = $$qtLibraryTarget(hive_devicepluginelro)
|
||||
|
||||
INCLUDEPATH += ../../../libhive
|
||||
LIBS += -L../../../libhive -lhive
|
||||
|
||||
SOURCES += \
|
||||
rfremotemumbi.cpp
|
||||
devicepluginelro.cpp
|
||||
|
||||
HEADERS += \
|
||||
rfremotemumbi.h
|
||||
devicepluginelro.h
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "rfremoteintertechno.h"
|
||||
#include "devicepluginintertechno.h"
|
||||
|
||||
#include "device.h"
|
||||
#include "devicemanager.h"
|
||||
@ -9,16 +9,16 @@
|
||||
|
||||
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;
|
||||
|
||||
@ -76,22 +76,22 @@ QList<DeviceClass> RfRemoteIntertechno::supportedDevices() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
QString RfRemoteIntertechno::pluginName() const
|
||||
QString DevicePluginIntertechno::pluginName() const
|
||||
{
|
||||
return "RF Remote Intertechno";
|
||||
}
|
||||
|
||||
QUuid RfRemoteIntertechno::pluginId() const
|
||||
QUuid DevicePluginIntertechno::pluginId() const
|
||||
{
|
||||
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
|
||||
if(rawData.length() != 49){
|
||||
@ -1,17 +1,17 @@
|
||||
#ifndef RFREMOTEINTERTECHNO_H
|
||||
#define RFREMOTEINTERTECHNO_H
|
||||
#ifndef DEVICEPLUGININTERTECHNO_H
|
||||
#define DEVICEPLUGININTERTECHNO_H
|
||||
|
||||
#include "deviceplugin.h"
|
||||
|
||||
class RfRemoteIntertechno : public DevicePlugin
|
||||
class DevicePluginIntertechno : public DevicePlugin
|
||||
{
|
||||
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)
|
||||
|
||||
public:
|
||||
explicit RfRemoteIntertechno();
|
||||
explicit DevicePluginIntertechno();
|
||||
|
||||
void init() override;
|
||||
QList<DeviceClass> supportedDevices() const override;
|
||||
@ -26,4 +26,4 @@ private slots:
|
||||
void dataReceived(QList<int> rawData);
|
||||
};
|
||||
|
||||
#endif // RFREMOTEINTERTECHNO_H
|
||||
#endif // DEVICEPLUGININTERTECHNO_H
|
||||
@ -1,15 +1,15 @@
|
||||
TEMPLATE = lib
|
||||
CONFIG += plugin static
|
||||
|
||||
TARGET = $$qtLibraryTarget(hive_rfremoteintertechno)
|
||||
TARGET = $$qtLibraryTarget(hive_devicepluginintertechno)
|
||||
|
||||
INCLUDEPATH += ../../../libhive
|
||||
LIBS += -L../../../libhive -lhive
|
||||
|
||||
SOURCES += \
|
||||
rfremoteintertechno.cpp
|
||||
devicepluginintertechno.cpp
|
||||
|
||||
HEADERS += \
|
||||
rfremoteintertechno.h
|
||||
devicepluginintertechno.h
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
TEMPLATE = subdirs
|
||||
SUBDIRS += rfremotemumbi rfremoteintertechno
|
||||
SUBDIRS += devicepluginelro devicepluginintertechno
|
||||
|
||||
|
||||
Reference in New Issue
Block a user