Socket
Socket
Sign inDemoInstall

node-red-contrib-sun-position

Package Overview
Dependencies
Maintainers
1
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-sun-position - npm Package Compare versions

Comparing version 0.2.8 to 0.2.9

4

nodes/lib/dateTimeHelper.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc