Skip to content

Commit f8a4571

Browse files
committed
fix: save modified settings back to file
Actually, save *all* settings to the mutable `settings.json5` file, including any settings statically specified in other, higher-precedence files, as well as any settings modified in the gateway control panel.
1 parent 6100644 commit f8a4571

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

gateway.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,14 +739,17 @@ io.sockets.on('connection', function (socket) {
739739
}
740740

741741
if (changed) {
742-
global.settings = settings;
742+
nconf.set('settings', settings)
743+
743744
nconf.save(function (err) {
744745
if (err !=null)
745746
socket.emit('LOG', 'UPDATESETTINGSDEF ERROR: '+err);
746747
else
747748
io.sockets.emit('SETTINGSDEF', settings);
748749
});
749-
750+
751+
global.settings = nconf.get('settings')
752+
750753
if (portChangedTo) {
751754
log = `PORT changed to ${portChangedTo} - reopening serial port @ ${settings.serial.baud.value} baud...`;
752755
openPort(true);

0 commit comments

Comments
 (0)