- Added node-red/config_files/flows_cred.json to .gitignore to prevent committing sensitive credentials. - Updated documentation references to the new location of room-config.js in node-red/config_files/ for clarity. - Removed the obsolete room-config.js file, centralizing configuration management. This update enhances security and improves the organization of Node-RED configuration files, ensuring better management of room settings.
25 lines
946 B
JavaScript
25 lines
946 B
JavaScript
// Load room config into global (no require - Function nodes can't use it).
|
|
// 1. Open node-red/config_files/room-config.js in the repo (mirror of server file).
|
|
// 2. Copy the whole object: from "const ROOM_CONFIG = {" up to "};" (do NOT copy "module.exports").
|
|
// 3. Replace the ROOM_CONFIG below with your paste. Keep the two lines at the end.
|
|
|
|
const ROOM_CONFIG = {
|
|
roomNames: ['cmd_livingroom', 'cmd_out'],
|
|
lightEntityMap: [
|
|
{ room: 'light_livingRoom', light: 1, entityId: 'input_boolean.living_room_new' },
|
|
],
|
|
entityToRoom: { living_room_new: 'cmd_livingroom' },
|
|
deviceToRoom: { 'Office Switch': 'cmd_livingroom' },
|
|
deviceIdToName: {},
|
|
switchBindings: {
|
|
'Office Switch': {
|
|
1: { room: 'cmd_livingroom', light: 1 },
|
|
2: { room: 'cmd_livingroom', light: 1 },
|
|
},
|
|
},
|
|
};
|
|
|
|
global.set('roomConfig', ROOM_CONFIG);
|
|
node.warn('[Load room config] loaded: ' + ROOM_CONFIG.roomNames.length + ' rooms');
|
|
return null;
|