knxultimate
Advanced tools
Comparing version 1.0.48 to 1.0.49
@@ -9,7 +9,11 @@ ![Sample Node](img/logo.png) | ||
<p> | ||
<b>Version 1.0.49</b> - April 2024<br/> | ||
- DPT9: auto transform a string value, to a numeric value.<br/> | ||
</p> | ||
<p> | ||
<b>Version 1.0.48</b> - February 2024<br/> | ||
- Maintenance release.<br/> | ||
</p> | ||
<p> | ||
@@ -16,0 +20,0 @@ <b>Version 1.0.47</b> - January 2024<br/> |
{ | ||
"name": "knxultimate", | ||
"description": "KNX IP protocol implementation for Node. This is the ENGINE of Node-Red KNX-Ultimate node.", | ||
"version": "1.0.48", | ||
"version": "1.0.49", | ||
"engines": { | ||
@@ -6,0 +6,0 @@ "node": ">=14" |
@@ -32,8 +32,18 @@ /** | ||
valuetype: 'basic', | ||
desc: '1-byte' | ||
desc: '1-byte', | ||
help: | ||
`// Datapoint for 1 byte. | ||
// For example, for DPT 238.102, HVAC Mode, the values are as following: | ||
// 0-Auto | ||
// 1-Heat | ||
// 3-Cool | ||
// 9-Fan | ||
// 14-Dry | ||
msg.payload = 0; // Auto | ||
return msg;` | ||
} | ||
exports.subtypes = { | ||
// 20.102 HVAC mode | ||
102: { | ||
// .102 HVAC mode | ||
'102': { | ||
name: 'HVAC_Mode', | ||
@@ -40,0 +50,0 @@ desc: '', |
@@ -39,4 +39,5 @@ /** | ||
if (!isFinite(value)) { | ||
knxLog.get().warn('DPT9: cannot write non-numeric or undefined value') | ||
knxLog.get().error('DPT9: cannot write non-numeric or undefined value'); | ||
} else { | ||
value = Number(value); // Sometime a number is passed as string. | ||
value = value.toFixed(2); // Fix issue with float having too many decimals. | ||
@@ -43,0 +44,0 @@ const arr = frexp(value) |
@@ -164,11 +164,15 @@ /** | ||
}; | ||
function cloneDpt(d) { | ||
let result = {}; | ||
result = JSON.parse(JSON.stringify(d)); | ||
result.fromBuffer = d.fromBuffer; | ||
result.formatAPDU = d.formatAPDU; | ||
return result; | ||
try { | ||
result = JSON.parse(JSON.stringify(d)); | ||
result.fromBuffer = d.fromBuffer; | ||
result.formatAPDU = d.formatAPDU; | ||
return result; | ||
} catch (error) { | ||
} | ||
} | ||
module.exports = dpts; |
@@ -57,3 +57,3 @@ 'use strict' | ||
TUNNELING_REQUEST_TIMEOUT: 1, | ||
CONNECTION_ALIVE_TIME: 60, | ||
CONNECTION_ALIVE_TIME: 30, // Max is 120secs by standard KNX specs. | ||
TUNNEL_LINKLAYER: 0x02, | ||
@@ -60,0 +60,0 @@ TUNNEL_RAW: 0x04, |
1499382
9717