node-red-contrib-knx-ultimate
Advanced tools
Comparing version
@@ -139,7 +139,11 @@ | ||
// Used in the KNX Function TAB | ||
let getGAValue = function getGAValue(ga = undefined, _dpt = undefined) { | ||
let getGAValue = function getGAValue(_ga = undefined, _dpt = undefined) { | ||
try { | ||
if (ga === undefined) return; | ||
if (_ga === undefined) return; | ||
// The GA can have the devicename as well, separated by a blank space (1/1/0 light table ovest), | ||
// I must take the GA only | ||
const blankSpacePosition = _ga.indexOf(" "); | ||
if (blankSpacePosition > -1) _ga = _ga.substring(0, blankSpacePosition); | ||
// Is there a GA in the server's exposedGAs? | ||
const found = node.server.exposedGAs.find(a => a.ga === ga); | ||
const found = node.server.exposedGAs.find(a => a.ga === _ga); | ||
if (found !== undefined) { | ||
@@ -146,0 +150,0 @@ if (_dpt === undefined && found.dpt === undefined) throw new Error('No CSV file imported. Please provide the dpt manually.'); |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"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": { |
@@ -42,3 +42,3 @@ // 31/03/2020 Search Helper | ||
// The current msg contains the internal temperature in the "msg.payload" property, but we want to emit the external temperature as well. | ||
msg.externalTemperature = getGAValue('0/0/10'); // In case the ETS file is missing, you must specify the dpt as well: getGAValue('0/0/10','9.001') | ||
msg.externalTemperature = getGAValue('0/0/10 Garden temperature sensor'); // In case the ETS file is missing, you must specify the dpt as well: getGAValue('0/0/10','9.001') | ||
return msg;`; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
6144040
0.06%10445
0.04%