mirror of https://github.com/nymea/nymea.git
Merge PR #147: Add auto device reconfigure mechanism
commit
8dc872b72b
|
|
@ -465,7 +465,7 @@ DeviceManager::DeviceError DeviceManager::addConfiguredDevice(const DeviceClassI
|
|||
* from a discovery or if the user set them. If it came from discovery not writable parameters (readOnly) will be changed too.
|
||||
*
|
||||
* Returns \l{DeviceError} to inform about the result. */
|
||||
DeviceManager::DeviceError DeviceManager::reconfigureDevice(const DeviceId &deviceId, const ParamList ¶ms, bool fromDiscovery)
|
||||
DeviceManager::DeviceError DeviceManager::reconfigureDevice(const DeviceId &deviceId, const ParamList ¶ms, bool fromDiscoveryOrAuto)
|
||||
{
|
||||
Device *device = findConfiguredDevice(deviceId);
|
||||
if (!device) {
|
||||
|
|
@ -487,7 +487,7 @@ DeviceManager::DeviceError DeviceManager::reconfigureDevice(const DeviceId &devi
|
|||
}
|
||||
|
||||
// if the params are discovered and not set by the user
|
||||
if (!fromDiscovery) {
|
||||
if (!fromDiscoveryOrAuto) {
|
||||
// check if one of the given params is not editable
|
||||
foreach (const ParamType ¶mType, deviceClass.paramTypes()) {
|
||||
foreach (const Param ¶m, params) {
|
||||
|
|
@ -1415,7 +1415,7 @@ void DeviceManager::onAutoDevicesAppeared(const DeviceClassId &deviceClassId, co
|
|||
continue;
|
||||
}
|
||||
qCDebug(dcDeviceManager()) << "Start reconfiguring auto device" << device;
|
||||
reconfigureDevice(deviceDescriptor.deviceId(), deviceDescriptor.params());
|
||||
reconfigureDevice(deviceDescriptor.deviceId(), deviceDescriptor.params(), true);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ public:
|
|||
DeviceError addConfiguredDevice(const DeviceClassId &deviceClassId, const QString &name, const ParamList ¶ms, const DeviceId id = DeviceId::createDeviceId());
|
||||
DeviceError addConfiguredDevice(const DeviceClassId &deviceClassId, const QString &name, const DeviceDescriptorId &deviceDescriptorId, const ParamList ¶ms = ParamList(), const DeviceId &deviceId = DeviceId::createDeviceId());
|
||||
|
||||
DeviceError reconfigureDevice(const DeviceId &deviceId, const ParamList ¶ms, bool fromDiscovery = false);
|
||||
DeviceError reconfigureDevice(const DeviceId &deviceId, const ParamList ¶ms, bool fromDiscoveryOrAuto = false);
|
||||
DeviceError reconfigureDevice(const DeviceId &deviceId, const DeviceDescriptorId &deviceDescriptorId);
|
||||
|
||||
DeviceError editDevice(const DeviceId &deviceId, const QString &name);
|
||||
|
|
|
|||
Loading…
Reference in New Issue