Migrate _loadConfig to use ConfigManager.buildConfig()
Replaces manual base config construction with shared buildConfig() method. Node now only specifies domain-specific config sections. Part of #1: Extract base config schema Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
const { Settler } = require('./specificClass.js');
|
const { Settler } = require('./specificClass.js');
|
||||||
|
const { configManager } = require('generalFunctions');
|
||||||
|
|
||||||
|
|
||||||
class nodeClass {
|
class nodeClass {
|
||||||
@@ -54,21 +55,8 @@ class nodeClass {
|
|||||||
* @param {object} uiConfig Config set in UI in node-red
|
* @param {object} uiConfig Config set in UI in node-red
|
||||||
*/
|
*/
|
||||||
_loadConfig(uiConfig) {
|
_loadConfig(uiConfig) {
|
||||||
this.config = {
|
const cfgMgr = new configManager();
|
||||||
general: {
|
this.config = cfgMgr.buildConfig('settler', uiConfig, this.node.id);
|
||||||
name: uiConfig.name || this.name,
|
|
||||||
id: this.node.id,
|
|
||||||
unit: null,
|
|
||||||
logging: {
|
|
||||||
enabled: uiConfig.enableLog,
|
|
||||||
logLevel: uiConfig.logLevel
|
|
||||||
}
|
|
||||||
},
|
|
||||||
functionality: {
|
|
||||||
positionVsParent: uiConfig.positionVsParent || 'atEquipment', // Default to 'atEquipment' if not specified
|
|
||||||
softwareType: "settler" // should be set in config manager
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user