Skip to content

Commit

Permalink
overwrite options only if config empty (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed May 19, 2019
1 parent bef7f53 commit 64014da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions nodes/ccu-get-value.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
if (nodeId !== '_ADD_') {
const url = 'ccu?config=' + nodeId + '&type=ifaces';
$.getJSON(url, d => {
$nodeInputIface.append('<option></option>');
Object.keys(d).forEach(i => {
$nodeInputIface.append('<option' + (d[i].enabled ? '' : ' disabled') + (i === node.iface ? ' selected' : '') + '>' + i + '</option>');
});
Expand Down
9 changes: 4 additions & 5 deletions nodes/ccu-get-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ module.exports = function (RED) {
}

this.on('input', msg => {
msg = RED.util.cloneMessage(msg);
let value;
const iface = msg.iface || config.iface;
const channel = msg.channel || config.channel.split(' ')[0];
const datapoint = msg.datapoint || config.datapoint;
const sysvar = msg.sysvar || config.sysvar;
const iface = config.iface || msg.iface;
const channel = String(config.channel).split(' ')[0] || msg.channel;
const datapoint = config.datapoint || msg.datapoint;
const sysvar = config.sysvar || msg.sysvar;

if (iface === 'ReGaHSS') {
value = this.ccu.sysvar[sysvar];
Expand Down

0 comments on commit 64014da

Please sign in to comment.