node-red-contrib-sun-position
Advanced tools
Comparing version 0.2.8 to 0.2.9
@@ -269,2 +269,3 @@ /******************************************** | ||
function checkLimits(num, low, high) { | ||
// console.debug('checkLimits num=' + num + ' low=' + low + ' high=' + high); // eslint-disable-line | ||
if (typeof low !== 'undefined' && low !== '' && !isNaN(low) && low >= 0) { | ||
@@ -275,6 +276,4 @@ if (typeof high !== 'undefined' && high !== '' && !isNaN(high) && high >= 0) { | ||
} | ||
return (num > low) || (num < high); | ||
} | ||
return (num > low); | ||
@@ -286,3 +285,2 @@ } | ||
} | ||
return false; | ||
@@ -289,0 +287,0 @@ } |
{ | ||
"moon-position": { | ||
"label": { | ||
"azimuthpos":"azimuth Position", | ||
"between":"zwischen", | ||
@@ -5,0 +6,0 @@ "and":"und" |
@@ -7,3 +7,2 @@ { | ||
"and":"und", | ||
"name": "Name", | ||
"start": "Start", | ||
@@ -10,0 +9,0 @@ "startOffset":"Start Offset", |
{ | ||
"moon-position": { | ||
"label": { | ||
"azimuthpos":"azimuth Position", | ||
"between":"between", | ||
@@ -5,0 +6,0 @@ "and":"and" |
{ | ||
"sun-position": { | ||
"label": { | ||
"azimuthpos":"azimuth position", | ||
"azimuthpos":"azimuth Position", | ||
"between":"between", | ||
"and":"and", | ||
"name": "Name", | ||
"start": "Start", | ||
@@ -9,0 +8,0 @@ "startOffset":"Start Offset", |
@@ -47,3 +47,5 @@ /******************************************** | ||
ports[i + 1] = RED.util.cloneMessage(msg); | ||
ports[i + 1].moonPos = chk; | ||
ports[i + 1].posChanged = chg; | ||
ports[i + 1].azimuth = ports[0].payload.azimuth; | ||
} | ||
@@ -74,25 +76,10 @@ } | ||
function getNumProp(srcNode, msg, vType, value) { | ||
// srcNode.debug('getNumProp vType=' + vType + ' value=' + value); | ||
const now = new Date(); | ||
let result = -1; | ||
if (vType === '' || vType === 'none') { | ||
// nix | ||
} else if (vType === 'num') { | ||
result = Number(now); | ||
} else { | ||
try { | ||
// evaluateNodeProperty(value, type, srcNode, msg, callback) | ||
const res = RED.util.evaluateNodeProperty(value, vType, srcNode, msg); | ||
if (res && !isNaN(res)) { | ||
result = Number(now); | ||
} else { | ||
srcNode.error('could not evaluate ' + vType + '.' + value); | ||
} | ||
} catch (err) { | ||
srcNode.error('could not evaluate ' + vType + '.' + value + ': ' + err.message); | ||
srcNode.debug(util.inspect(err, Object.getOwnPropertyNames(err))); | ||
try { | ||
if (vType === 'none') { | ||
return undefined; | ||
} | ||
return node.positionConfig.getFloatProp(node, msg, vType, value); | ||
} catch (err) { | ||
return undefined; | ||
} | ||
return result; | ||
} | ||
@@ -99,0 +86,0 @@ } |
@@ -95,6 +95,3 @@ /******************************************** | ||
ports[i + 1].posChanged = chg; | ||
if (typeof ports[i + 1].payload === 'object') { | ||
ports[i + 1].payload.sunPos = chk; | ||
ports[i + 1].payload.posChanged = chg; | ||
} | ||
ports[i + 1].azimuth = ports[0].payload.azimuth; | ||
} | ||
@@ -150,25 +147,10 @@ } | ||
function getNumProp(srcNode, msg, vType, value) { | ||
// srcNode.debug('getNumProp vType=' + vType + ' value=' + value); | ||
const now = new Date(); | ||
let result = -1; | ||
if (vType === '' || vType === 'none') { | ||
// nix | ||
} else if (vType === 'num') { | ||
result = Number(now); | ||
} else { | ||
try { | ||
// evaluateNodeProperty(value, type, srcNode, msg, callback) | ||
const res = RED.util.evaluateNodeProperty(value, vType, srcNode, msg); | ||
if (res && !isNaN(res)) { | ||
result = Number(now); | ||
} else { | ||
srcNode.error('could not evaluate ' + vType + '.' + value); | ||
} | ||
} catch (err) { | ||
srcNode.error('could not evaluate ' + vType + '.' + value + ': ' + err.message); | ||
srcNode.debug(util.inspect(err, Object.getOwnPropertyNames(err))); | ||
try { | ||
if (vType === 'none') { | ||
return undefined; | ||
} | ||
return node.positionConfig.getFloatProp(node, msg, vType, value); | ||
} catch (err) { | ||
return undefined; | ||
} | ||
return result; | ||
} | ||
@@ -175,0 +157,0 @@ } |
{ | ||
"name": "node-red-contrib-sun-position", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"description": "NodeRED nodes to get sun and moon position", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1252905
5503