Update elro plugin
This commit is contained in:
parent
f299653607
commit
459c3e8576
@ -32,13 +32,16 @@ DevicePluginElro::DevicePluginElro()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Device::DeviceError DevicePluginElro::executeAction(Device *device, const Action &action)
|
void DevicePluginElro::executeAction(DeviceActionInfo *info)
|
||||||
{
|
{
|
||||||
|
Device *device = info->device();
|
||||||
|
Action action = info->action();
|
||||||
|
|
||||||
if (!hardwareManager()->radio433()->available())
|
if (!hardwareManager()->radio433()->available())
|
||||||
return Device::DeviceErrorHardwareNotAvailable;
|
return info->finish(Device::DeviceErrorHardwareNotAvailable);
|
||||||
|
|
||||||
if (action.actionTypeId() != elroSocketPowerActionTypeId)
|
if (action.actionTypeId() != elroSocketPowerActionTypeId)
|
||||||
return Device::DeviceErrorActionTypeNotFound;
|
return info->finish(Device::DeviceErrorActionTypeNotFound);
|
||||||
|
|
||||||
QList<int> rawData;
|
QList<int> rawData;
|
||||||
QByteArray binCode;
|
QByteArray binCode;
|
||||||
@ -128,10 +131,10 @@ Device::DeviceError DevicePluginElro::executeAction(Device *device, const Action
|
|||||||
qCDebug(dcElro) << "Transmitted" << pluginName() << device->name() << "power: " << action.param(elroSocketPowerActionPowerParamTypeId).value().toBool();
|
qCDebug(dcElro) << "Transmitted" << pluginName() << device->name() << "power: " << action.param(elroSocketPowerActionPowerParamTypeId).value().toBool();
|
||||||
} else {
|
} else {
|
||||||
qCWarning(dcElro) << "Could not transmitt" << pluginName() << device->name() << "power: " << action.param(elroSocketPowerActionPowerParamTypeId).value().toBool();
|
qCWarning(dcElro) << "Could not transmitt" << pluginName() << device->name() << "power: " << action.param(elroSocketPowerActionPowerParamTypeId).value().toBool();
|
||||||
return Device::DeviceErrorHardwareNotAvailable;
|
return info->finish(Device::DeviceErrorHardwareNotAvailable);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Device::DeviceErrorNoError;
|
info->finish(Device::DeviceErrorNoError);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DevicePluginElro::radioData(const QList<int> &rawData)
|
void DevicePluginElro::radioData(const QList<int> &rawData)
|
||||||
|
|||||||
@ -38,7 +38,7 @@ public:
|
|||||||
void radioData(const QList<int> &rawData);
|
void radioData(const QList<int> &rawData);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
Device::DeviceError executeAction(Device *device, const Action &action) override;
|
void executeAction(DeviceActionInfo *info) override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user