diff --git a/genericelements/deviceplugingenericelements.cpp b/genericelements/deviceplugingenericelements.cpp index 59bf074..928add1 100644 --- a/genericelements/deviceplugingenericelements.cpp +++ b/genericelements/deviceplugingenericelements.cpp @@ -53,7 +53,6 @@ #include "deviceplugingenericelements.h" -#include "devicemanager.h" #include "plugininfo.h" #include @@ -62,52 +61,52 @@ DevicePluginGenericElements::DevicePluginGenericElements() { } -DeviceManager::DeviceSetupStatus DevicePluginGenericElements::setupDevice(Device *device) +Device::DeviceSetupStatus DevicePluginGenericElements::setupDevice(Device *device) { // Toggle Button if (device->deviceClassId() == toggleButtonDeviceClassId) { - return DeviceManager::DeviceSetupStatusSuccess; + return Device::DeviceSetupStatusSuccess; } // Button if (device->deviceClassId() == buttonDeviceClassId) { - return DeviceManager::DeviceSetupStatusSuccess; + return Device::DeviceSetupStatusSuccess; } // ON/OFF Button if (device->deviceClassId() == onOffButtonDeviceClassId) { - return DeviceManager::DeviceSetupStatusSuccess; + return Device::DeviceSetupStatusSuccess; } - return DeviceManager::DeviceSetupStatusFailure; + return Device::DeviceSetupStatusFailure; } -DeviceManager::DeviceError DevicePluginGenericElements::executeAction(Device *device, const Action &action) +Device::DeviceError DevicePluginGenericElements::executeAction(Device *device, const Action &action) { // Toggle Button if (device->deviceClassId() == toggleButtonDeviceClassId ) { if (action.actionTypeId() == toggleButtonStateActionTypeId) { device->setStateValue(toggleButtonStateStateTypeId, !device->stateValue(toggleButtonStateStateTypeId).toBool()); - return DeviceManager::DeviceErrorNoError; + return Device::DeviceErrorNoError; } - return DeviceManager::DeviceErrorActionTypeNotFound; + return Device::DeviceErrorActionTypeNotFound; } // Button if (device->deviceClassId() == buttonDeviceClassId ) { if (action.actionTypeId() == buttonButtonPressActionTypeId) { emit emitEvent(Event(buttonButtonPressedEventTypeId, device->id())); - return DeviceManager::DeviceErrorNoError; + return Device::DeviceErrorNoError; } - return DeviceManager::DeviceErrorActionTypeNotFound; + return Device::DeviceErrorActionTypeNotFound; } // ON/OFF Button if (device->deviceClassId() == onOffButtonDeviceClassId ) { if (action.actionTypeId() == onOffButtonOnActionTypeId) { emit emitEvent(Event(onOffButtonOnEventTypeId, device->id())); - return DeviceManager::DeviceErrorNoError; + return Device::DeviceErrorNoError; } if (action.actionTypeId() == onOffButtonOffActionTypeId) { emit emitEvent(Event(onOffButtonOffEventTypeId, device->id())); - return DeviceManager::DeviceErrorNoError; + return Device::DeviceErrorNoError; } - return DeviceManager::DeviceErrorActionTypeNotFound; + return Device::DeviceErrorActionTypeNotFound; } - return DeviceManager::DeviceErrorDeviceClassNotFound; + return Device::DeviceErrorDeviceClassNotFound; } diff --git a/genericelements/deviceplugingenericelements.h b/genericelements/deviceplugingenericelements.h index 0d82d4b..5c9d0be 100644 --- a/genericelements/deviceplugingenericelements.h +++ b/genericelements/deviceplugingenericelements.h @@ -23,7 +23,7 @@ #ifndef DEVICEPLUGINGENERICELEMENTS_H #define DEVICEPLUGINGENERICELEMENTS_H -#include "plugin/deviceplugin.h" +#include "devices/deviceplugin.h" class DevicePluginGenericElements : public DevicePlugin { @@ -34,10 +34,10 @@ class DevicePluginGenericElements : public DevicePlugin public: explicit DevicePluginGenericElements(); - DeviceManager::DeviceSetupStatus setupDevice(Device *device) override; + Device::DeviceSetupStatus setupDevice(Device *device) override; public slots: - DeviceManager::DeviceError executeAction(Device *device, const Action &action) override; + Device::DeviceError executeAction(Device *device, const Action &action) override; };