Skip to content

Commit

Permalink
queue setValue commands
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Feb 7, 2019
1 parent 23e5840 commit cc8cbfc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
15 changes: 13 additions & 2 deletions nodes/ccu-value.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
start: {value: true},
change: {value: true},
cache: {value: false},
queue: {value: false},
on: {value: ''},
onType: {value: 'undefined'},
ramp: {value: ''},
Expand Down Expand Up @@ -286,9 +287,19 @@
</div>

<div class="form-row">
<label for="node-input-change"><i class="icon-bookmark"></i> </label>
<label for="node-input-queue"><i class="icon-bookmark"></i> </label>
<div style="width: 70%; display: inline-block; vertical-align: text-top;">
<label class="ccu-checkbox" for="node-input-change">
<label class="ccu-checkbox" for="node-input-queue">
<input type="checkbox" id="node-input-queue">
<span data-i18n="ccu-value.queue"></span>
</label>
</div>
</div>

<div class="form-row">
<label for="node-input-change"><i class="icon-bookmark"></i> </label>
<div style="width: 70%; display: inline-block; vertical-align: text-top;">
<label class="ccu-checkbox" for="node-input-change">
<input type="checkbox" id="node-input-change">
<span data-i18n="ccu-value.change"></span>
</label>
Expand Down
4 changes: 3 additions & 1 deletion nodes/ccu-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = function (RED) {
}

this.iface = config.iface;
this.queue = config.queue;

this.ccu.register(this);

Expand Down Expand Up @@ -91,7 +92,7 @@ module.exports = function (RED) {
on = parseFloat(on);

if (!ramp && !on) {
this.ccu.setValue(iface, channel, datapoint, msg.payload, config.burst);
this.ccu[this.queue ? 'setValueQueued' : 'setValue'](iface, channel, datapoint, msg.payload, config.burst);
} else {
const params = {};
if (on) {
Expand All @@ -101,6 +102,7 @@ module.exports = function (RED) {
params.RAMP_TIME = this.ccu.paramCast(iface, channel, 'VALUES', 'RAMP_TIME', ramp);
}
params[datapoint] = this.ccu.paramCast(iface, channel, 'VALUES', datapoint, msg.payload);
// Todo queue
this.ccu.methodCall(iface, 'putParamset', [channel, 'VALUES', params]);
}
});
Expand Down
5 changes: 3 additions & 2 deletions nodes/locales/de-DE/ccu-value.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"tip5": "Es ist zu beachten dass dieser Node nur dann Nachrichten ausgibt wenn Interface, Channel und Datapoint gesetzt sind. Um Events von mehreren Aktoren zu empfangen bitte den \"rpc event\" Node nutzen.",
"change": "Nur geänderte Werte ausgeben",
"cache": "Beim Start letzten bekannten Wert ausgeben",
"working": "Während WORKING keine Werte ausgeben"
"working": "Während WORKING keine Werte ausgeben",
"queue": "Queue"
}
}
}
3 changes: 2 additions & 1 deletion nodes/locales/en-US/ccu-value.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"tip5": "Mind that this node only emits messages if Interface, Channel und Datapoint are set. To receive events from multiple actuators please use the \"rpc event\" node.",
"change": "Emit changed values only",
"cache": "Emit cached value on start",
"working": "Don't emit values while actuator is in WORKING state"
"working": "Don't emit values while actuator is in WORKING state",
"queue": "Queue Commands"
}
}

0 comments on commit cc8cbfc

Please sign in to comment.