From bd4d3000e1b8558f510d6730be03e38a404278cb Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Thu, 19 Sep 2019 23:19:25 +0200 Subject: [PATCH] Update wakeonlan plugin --- wakeonlan/devicepluginwakeonlan.cpp | 10 ++++------ wakeonlan/devicepluginwakeonlan.h | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/wakeonlan/devicepluginwakeonlan.cpp b/wakeonlan/devicepluginwakeonlan.cpp index e816dace..0fe03727 100644 --- a/wakeonlan/devicepluginwakeonlan.cpp +++ b/wakeonlan/devicepluginwakeonlan.cpp @@ -33,13 +33,11 @@ DevicePluginWakeOnLan::DevicePluginWakeOnLan() { } -Device::DeviceError DevicePluginWakeOnLan::executeAction(Device *device, const Action &action) +void DevicePluginWakeOnLan::executeAction(DeviceActionInfo *info) { - if(action.actionTypeId() == wolTriggerActionTypeId){ - qCDebug(dcWakeOnLan) << "Wake up" << device->name(); - wakeup(device->paramValue(wolDeviceMacParamTypeId).toString()); - } - return Device::DeviceErrorNoError; + qCDebug(dcWakeOnLan) << "Wake up" << info->device()->name(); + wakeup(info->device()->paramValue(wolDeviceMacParamTypeId).toString()); + return info->finish(Device::DeviceErrorNoError); } void DevicePluginWakeOnLan::wakeup(QString mac) diff --git a/wakeonlan/devicepluginwakeonlan.h b/wakeonlan/devicepluginwakeonlan.h index 0e0a197d..fceeed16 100644 --- a/wakeonlan/devicepluginwakeonlan.h +++ b/wakeonlan/devicepluginwakeonlan.h @@ -37,7 +37,7 @@ class DevicePluginWakeOnLan : public DevicePlugin public: explicit DevicePluginWakeOnLan(); - Device::DeviceError executeAction(Device *device, const Action &action) override; + void executeAction(DeviceActionInfo *info) override; private slots: void wakeup(QString mac);