victron-vrm-api
Version:
Interface with the Victron Energy VRM API
24 lines (21 loc) • 564 B
JavaScript
module.exports = function (RED) {
'use strict'
function ConfigVRMAPI (config) {
RED.nodes.createNode(this, config)
this.name = config.name
// Transfer data from previous versions
if (this.credentials && !this.credentials.token && config.token) {
RED.nodes.addCredentials(this.id, { token: config.token })
}
// Delete deprecated properties
delete config.token
delete this.token
}
RED.nodes.registerType('config-vrm-api', ConfigVRMAPI, {
credentials: {
token: {
type: 'password'
}
}
})
}