mirror of https://github.com/nymea/nymea.git
Merge PR #215: Always initialize device settings params
commit
c066962a66
|
|
@ -1207,6 +1207,13 @@ void DeviceManagerImplementation::loadConfiguredDevices()
|
|||
}
|
||||
}
|
||||
DeviceUtils::verifyParams(deviceClass.settingsTypes(), deviceSettings);
|
||||
// Make sure all settings are around. if they aren't initialize with default values
|
||||
foreach (const ParamType &settingsType, deviceClass.settingsTypes()) {
|
||||
if (!deviceSettings.hasParam(settingsType.id())) {
|
||||
deviceSettings.append(Param(settingsType.id(), settingsType.defaultValue().isValid() ? settingsType.defaultValue() : ""));
|
||||
}
|
||||
}
|
||||
|
||||
device->setSettings(deviceSettings);
|
||||
|
||||
settings.endGroup(); // Settings
|
||||
|
|
|
|||
Loading…
Reference in New Issue