mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-15 09:58:45 -07:00
Dont add advanced configuration by default.
This commit is contained in:
parent
fb27bd292f
commit
312ed033db
@ -18,8 +18,3 @@ mqtt:
|
||||
serial:
|
||||
# Location of CC2531 USB sniffer
|
||||
port: /dev/ttyACM0
|
||||
|
||||
# Advanced configuration
|
||||
advanced:
|
||||
version: 1
|
||||
pan_id: 0x1a62
|
||||
|
@ -2,23 +2,9 @@ const YAWN = require('yawn-yaml/cjs');
|
||||
const fs = require('fs');
|
||||
const data = require('./data');
|
||||
const file = data.joinPath('configuration.yaml');
|
||||
const logger = require('./logger');
|
||||
|
||||
let yawn = read();
|
||||
|
||||
// Migrate configuration.
|
||||
if (!yawn.json.advanced) {
|
||||
// 1: Add advanced section to configuration.yaml
|
||||
logger.info('Migrating configuration.yaml to version 1...');
|
||||
yawn.yaml += '\n\n' +
|
||||
'# Advanced configuration\n' +
|
||||
'advanced:\n' +
|
||||
' version: 1\n' +
|
||||
' pan_id: 0x1a62\n';
|
||||
|
||||
writeRead();
|
||||
}
|
||||
|
||||
function writeRead() {
|
||||
write();
|
||||
yawn = read();
|
||||
|
@ -4,10 +4,12 @@ const settings = require('./util/settings');
|
||||
const data = require('./util/data');
|
||||
const debug = require('debug')('zigbee2mqtt:zigbee');
|
||||
|
||||
const advancedSettings = settings.get().advanced;
|
||||
|
||||
const shepherdSettings = {
|
||||
net: {
|
||||
panId: settings.get().advanced.pan_id,
|
||||
channelList: [settings.get().advanced.hasOwnProperty('channel') ? settings.get().advanced.channel : 11],
|
||||
panId: advancedSettings && advancedSettings.pan_id ? advancedSettings.pan_id : 0x1a62,
|
||||
channelList: [advancedSettings && advancedSettings.channel ? advancedSettings.channel : 11],
|
||||
},
|
||||
dbPath: data.joinPath('database.db'),
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user