Allow to change non-setted options via device_options. #3215

This commit is contained in:
Koen Kanters committed 2020-03-28 19:48:05 +01:00
1 parent e49b733fae
commit fb4d86cef5
2 files changed
+16 -8

No files matched your search

+1 -8
View File
@@ -625,14 +625,7 @@ function removeGroup(groupIDorName) {
function changeDeviceOptions(IDorName, newOptions) {
const device = getDeviceThrowIfNotExists(IDorName);
const settings = get();
const currentOptions = settings.devices[device.ID];
Object.keys(currentOptions).forEach((key) => {
if (newOptions[key]) {
currentOptions[key] = newOptions[key];
}
});
objectAssignDeep(settings.devices[device.ID], newOptions);
write();
}