From cc8cbfc797e073c48e7c0bad3647dfaa0e8cc97e Mon Sep 17 00:00:00 2001 From: hobbyquaker Date: Thu, 7 Feb 2019 17:36:12 +0100 Subject: [PATCH] queue setValue commands --- nodes/ccu-value.html | 15 +++++++++++++-- nodes/ccu-value.js | 4 +++- nodes/locales/de-DE/ccu-value.json | 5 +++-- nodes/locales/en-US/ccu-value.json | 3 ++- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/nodes/ccu-value.html b/nodes/ccu-value.html index 46b1f38..d7b43c5 100644 --- a/nodes/ccu-value.html +++ b/nodes/ccu-value.html @@ -11,6 +11,7 @@ start: {value: true}, change: {value: true}, cache: {value: false}, + queue: {value: false}, on: {value: ''}, onType: {value: 'undefined'}, ramp: {value: ''}, @@ -286,9 +287,19 @@
- +
-
+
+ +
+ +
+ diff --git a/nodes/ccu-value.js b/nodes/ccu-value.js index f967714..c66d635 100644 --- a/nodes/ccu-value.js +++ b/nodes/ccu-value.js @@ -14,6 +14,7 @@ module.exports = function (RED) { } this.iface = config.iface; + this.queue = config.queue; this.ccu.register(this); @@ -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) { @@ -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]); } }); diff --git a/nodes/locales/de-DE/ccu-value.json b/nodes/locales/de-DE/ccu-value.json index f644956..e505cbe 100644 --- a/nodes/locales/de-DE/ccu-value.json +++ b/nodes/locales/de-DE/ccu-value.json @@ -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" } -} \ No newline at end of file +} diff --git a/nodes/locales/en-US/ccu-value.json b/nodes/locales/en-US/ccu-value.json index 047ad3f..7f0cb9b 100644 --- a/nodes/locales/en-US/ccu-value.json +++ b/nodes/locales/en-US/ccu-value.json @@ -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" } }