diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d507d6..5cbb31c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,10 @@ This can be also used to go back to an older Version. ### 2.0.8: bug fixes - - general, but only used in blind-control + clock-time - - fixed string with placeholder output (string could not be entered) +- general, but only used in blind-control + clock-time + - added node.path (Node-Red 2.2) as possible output configuration, fallback to node.name or node.id if not defined + - fixed string with placeholder output (string could not be entered) + ### 2.0.7: maintenance release - blind-control + clock-time diff --git a/nodes/blind-control.html b/nodes/blind-control.html index 0d8b698..c08f040 100644 --- a/nodes/blind-control.html +++ b/nodes/blind-control.html @@ -394,7 +394,8 @@ env: 'Environment variable', jsonata: 'result of jsonata expression', nodeId: 'additional node ID', - nodeName: this.name + nodeName: this.name, + nodePath: this._path || this.name }; // if only payload and topic - display payload type @@ -2173,7 +2174,8 @@ types.randmNumCachedDay, types.randmNumCachedWeek, types.nodeId, - types.nodeName + types.nodeName, + types.nodePath ] }); setTInputValue($propertyValue, prop.v, prop.vt); @@ -2418,7 +2420,8 @@ types.DayOfYearEven, types.SunControlModeType, types.nodeId, - types.nodeName + types.nodeName, + types.nodePath ] }); setTInputValue($dialogCondOperand, data.value, data.valueType); diff --git a/nodes/clock-timer.html b/nodes/clock-timer.html index ac58b92..09c7eb0 100644 --- a/nodes/clock-timer.html +++ b/nodes/clock-timer.html @@ -144,7 +144,8 @@ env: 'Environment variable', jsonata: 'result of jsonata expression', nodeId: 'additional node ID', - nodeName: this.name + nodeName: this.name, + nodePath: this._path || this.name }; // if only payload and topic - display payload type @@ -1280,7 +1281,8 @@ types.randmNumCachedDay, types.randmNumCachedWeek, types.nodeId, - types.nodeName + types.nodeName, + types.nodePath ] }); setTInputValue($propertyValue, prop.v, prop.vt); @@ -1524,7 +1526,8 @@ types.DayOfYear, types.DayOfYearEven, types.nodeId, - types.nodeName + types.nodeName, + types.nodePath ] }); setTInputValue($dialogCondOperand, data.value, data.valueType); diff --git a/nodes/locales/de/position-config.json b/nodes/locales/de/position-config.json index 03b4e7d..2507fcb 100644 --- a/nodes/locales/de/position-config.json +++ b/nodes/locales/de/position-config.json @@ -41,6 +41,7 @@ "datespecific": "Zeitpunkt (erweitert)", "nodeId":"Node Name", "nodeName":"Node ID", + "nodePath":"Node Pfad", "timeentered": "Uhrzeit (nächste)", "dateentered": "Datum (spezieller Zeitpunkt)", "timepredefined": "Uhrzeit speziell", diff --git a/nodes/locales/en-US/position-config.json b/nodes/locales/en-US/position-config.json index 4f2d447..abe332b 100644 --- a/nodes/locales/en-US/position-config.json +++ b/nodes/locales/en-US/position-config.json @@ -41,6 +41,7 @@ "datespecific":"timestamp enhanced", "nodeId":"node name", "nodeName":"node ID", + "nodePath":"node path", "timeentered":"time (next)", "dateentered":"date", "timepredefined":"fixed times", diff --git a/nodes/position-config.html b/nodes/position-config.html index 6a1c6b8..ccdf30c 100644 --- a/nodes/position-config.html +++ b/nodes/position-config.html @@ -421,6 +421,8 @@ return node._('node-red-contrib-sun-position/position-config:common.types.nodeId') + suffix; case 'nodeName': return node._('node-red-contrib-sun-position/position-config:common.types.nodeName') + suffix; + case 'nodePath': + return node._('node-red-contrib-sun-position/position-config:common.types.nodePath') + suffix; case 'PlT': return node._('node-red-contrib-sun-position/position-config:common.typeOptions.PlTRes',{topic: RED.nodes.getType('position-config').clipValueLength(v, l), suffix} ); case 'msgPayload': diff --git a/nodes/position-config.js b/nodes/position-config.js index 0ee6a13..94c54ec 100644 --- a/nodes/position-config.js +++ b/nodes/position-config.js @@ -1119,7 +1119,9 @@ module.exports = function (RED) { } else if (data.type === 'nodeId') { return _srcNode.addId || _srcNode.id; } else if (data.type === 'nodeName') { - return _srcNode.name || _srcNode.id; // if empty fallback to node ID + return _srcNode.name || _srcNode._path || _srcNode.id; // if empty fallback to node ID + } else if (data.type === 'nodePath') { + return _srcNode._path || _srcNode.id; // if empty fallback to node ID } else if (data.type === 'randmNumCachedDay') { const val = data.value.split(/((?:[1-9]|-0\.|0\.|-)\d*(?:\.\d+)?)/); return this.getCachedRandomDayNumber(_srcNode, parseFloat(val[1]), parseFloat(val[3]), dNow); diff --git a/nodes/static/htmlglobal.js b/nodes/static/htmlglobal.js index 85219d0..c16dd0e 100644 --- a/nodes/static/htmlglobal.js +++ b/nodes/static/htmlglobal.js @@ -245,6 +245,11 @@ function getTypes(node) { // eslint-disable-line no-unused-vars label: node._('node-red-contrib-sun-position/position-config:common.types.nodeName','node name'), hasValue: false }, + nodePath: { + value: 'nodePath', + label: node._('node-red-contrib-sun-position/position-config:common.types.nodePath','node name'), + hasValue: false + }, TimeEntered: { value: 'entered', label: node._('node-red-contrib-sun-position/position-config:common.types.timeentered','time (next)'), diff --git a/nodes/time-comp.html b/nodes/time-comp.html index 275be15..441b5d0 100644 --- a/nodes/time-comp.html +++ b/nodes/time-comp.html @@ -623,7 +623,7 @@ types.randmNumCachedDay, types.randmNumCachedWeek, types.nodeId, - types.nodeName + types.nodeNamec ] }); setTInputValue($propertyValue, prop.v, prop.vt); diff --git a/nodes/time-inject.html b/nodes/time-inject.html index 866b1e4..c96d423 100644 --- a/nodes/time-inject.html +++ b/nodes/time-inject.html @@ -858,7 +858,8 @@ types.randmNumCachedDay, types.randmNumCachedWeek, types.nodeId, - types.nodeName + types.nodeName, + types.nodePath ] }); setTInputValue($propertyValue, prop.v, prop.vt); diff --git a/nodes/time-span.html b/nodes/time-span.html index 4001e5b..b75f763 100644 --- a/nodes/time-span.html +++ b/nodes/time-span.html @@ -600,7 +600,8 @@ types.randmNumCachedDay, types.randmNumCachedWeek, types.nodeId, - types.nodeName + types.nodeName, + types.nodePath ] }); setTInputValue($propertyValue, prop.v, prop.vt); diff --git a/nodes/within-time-switch.html b/nodes/within-time-switch.html index e239e30..69c08f7 100644 --- a/nodes/within-time-switch.html +++ b/nodes/within-time-switch.html @@ -885,7 +885,8 @@ types.DayOfYear, types.DayOfYearEven, types.nodeId, - types.nodeName + types.nodeName, + types.nodePath ] }); if (node.outOfTimeValueType === 'input') { @@ -932,7 +933,8 @@ types.DayOfYear, types.DayOfYearEven, types.nodeId, - types.nodeName + types.nodeName, + types.nodePath ] }); // #endregion Output Values