node-red-contrib-knx-ultimate
Advanced tools
Comparing version
@@ -165,6 +165,7 @@ module.exports = function (RED) { | ||
if (oGa !== undefined) { | ||
let decodedPayload; | ||
try { | ||
// Don't care about the decoded payload, because knxUltimate-config could pass a TryToFindDatapoint from raw data | ||
// Take only RAW data and decode it with the dpt specified by the commandText directive | ||
const decodedPayload = dptlib.fromBuffer(msg.knx.rawValue, dptlib.resolve(oGa.dpt)); | ||
decodedPayload = dptlib.fromBuffer(msg.knx.rawValue, dptlib.resolve(oGa.dpt)); | ||
} catch (error) { | ||
@@ -189,4 +190,8 @@ node.status({ fill: 'red', shape: 'dot', text: 'const decodedPayload = dptlib.fromBuffer(msg.knx.rawValue, dptlib.resolve(oGa.dpt)); ' + error.message, payload: '', dpt: '', devicename: '' }); | ||
const dDate = new Date() | ||
node.status({ fill: 'blue', shape: 'dot', text: 'Respond ' + oFoundGA.address + ' => ' + retVal + ' (' + dDate.getDate() + ', ' + dDate.toLocaleTimeString() + ')' }) | ||
node.server.writeQueueAdd({ grpaddr: oFoundGA.address, payload: retVal, dpt: oFoundGA.dpt, outputtype: 'response', nodecallerid: node.id }); | ||
if (oFoundGA.address !== undefined && oFoundGA.dpt !== undefined && retVal !== undefined) { | ||
node.server.writeQueueAdd({ grpaddr: oFoundGA.address, payload: retVal, dpt: oFoundGA.dpt, outputtype: 'response', nodecallerid: node.id }); | ||
node.status({ fill: 'blue', shape: 'dot', text: 'Respond ' + oFoundGA.address + ' => ' + retVal + ' (' + dDate.getDate() + ', ' + dDate.toLocaleTimeString() + ')' }) | ||
} else { | ||
node.status({ fill: 'yellow', shape: 'ring', text: 'Issue responding ' + oFoundGA.address + ' => ' + retVal + ' (' + dDate.getDate() + ', ' + dDate.toLocaleTimeString() + ')' }) | ||
} | ||
} | ||
@@ -193,0 +198,0 @@ } catch (error) { |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "3.0.7", | ||
"version": "3.0.8", | ||
"description": "Control your KNX intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control and ETS group address importer. Easy to use and highly configurable.", | ||
@@ -9,0 +9,0 @@ "dependencies": { |
Sorry, the diff of this file is too big to display
7626874
0.01%20144
0.02%