fixed issues reported by reviewer
parent
e4903e00ac
commit
dbe06d76c5
|
|
@ -64,12 +64,6 @@ Device::DeviceError DevicePluginOneWire::discoverDevices(const DeviceClassId &de
|
|||
|
||||
Device::DeviceSetupStatus DevicePluginOneWire::setupDevice(Device *device)
|
||||
{
|
||||
|
||||
if(!m_pluginTimer) {
|
||||
m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(10);
|
||||
connect(m_pluginTimer, &PluginTimer::timeout, this, &DevicePluginOneWire::onPluginTimer);
|
||||
}
|
||||
|
||||
if (device->deviceClassId() == oneWireInterfaceDeviceClassId) {
|
||||
qCDebug(dcOneWire) << "Setup one wire interface";
|
||||
|
||||
|
|
@ -136,9 +130,18 @@ Device::DeviceSetupStatus DevicePluginOneWire::setupDevice(Device *device)
|
|||
return Device::DeviceSetupStatusFailure;
|
||||
}
|
||||
|
||||
void DevicePluginOneWire::postSetupDevice(Device *device)
|
||||
{
|
||||
Q_UNUSED(device);
|
||||
|
||||
if(!m_pluginTimer) {
|
||||
m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(10);
|
||||
connect(m_pluginTimer, &PluginTimer::timeout, this, &DevicePluginOneWire::onPluginTimer);
|
||||
}
|
||||
}
|
||||
|
||||
Device::DeviceError DevicePluginOneWire::executeAction(Device *device, const Action &action)
|
||||
{
|
||||
Q_UNUSED(action)
|
||||
if (device->deviceClassId() == oneWireInterfaceDeviceClassId) {
|
||||
if (action.actionTypeId() == oneWireInterfaceAutoAddActionTypeId){
|
||||
device->setStateValue(oneWireInterfaceAutoAddStateTypeId, action.param(oneWireInterfaceAutoAddActionAutoAddParamTypeId).value());
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ public:
|
|||
|
||||
Device::DeviceError discoverDevices(const DeviceClassId &deviceClassId, const ParamList ¶ms) override;
|
||||
Device::DeviceSetupStatus setupDevice(Device *device) override;
|
||||
void postSetupDevice(Device *device) override;
|
||||
Device::DeviceError executeAction(Device *device, const Action &action) override;
|
||||
void deviceRemoved(Device *device) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -104,15 +104,15 @@
|
|||
],
|
||||
"stateTypes": [
|
||||
{
|
||||
"id": "ca10a9fd-e4e0-4608-a2d2-6a4ce9644f40",
|
||||
"name": "digitalOutput",
|
||||
"displayName": "Digital output",
|
||||
"displayNameEvent": "Digital output changed",
|
||||
"displayNameAction": "Set digital output",
|
||||
"type": "bool",
|
||||
"defaultValue": false,
|
||||
"writable": true
|
||||
}
|
||||
"id": "ca10a9fd-e4e0-4608-a2d2-6a4ce9644f40",
|
||||
"name": "digitalOutput",
|
||||
"displayName": "Digital output",
|
||||
"displayNameEvent": "Digital output changed",
|
||||
"displayNameAction": "Set digital output",
|
||||
"type": "bool",
|
||||
"defaultValue": false,
|
||||
"writable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue