node-red-contrib-home-assistant-websocket
Version:
Node-RED integration with Home Assistant through websocket and REST API
25 lines (24 loc) • 740 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getExposedSettings = getExposedSettings;
const const_1 = require("../const");
const migrate_1 = require("./migrate");
const utils_1 = require("./utils");
function getExposedSettings(type) {
const name = (0, utils_1.toCamelCase)(type).replace(/-/g, '');
const expose = {
settings: {
[`${name}Version`]: {
value: (0, migrate_1.getCurrentVersion)(type),
exportable: true,
},
},
};
if (type === const_1.NodeType.Server) {
expose.credentials = {
host: { type: 'text' },
access_token: { type: 'text' },
};
}
return expose;
}
;