mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-29 07:08:56 +00:00
Allow to change non-setted options via device_options. #3215
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user