Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.5.2 to 0.5.3

5

CHANGELOG.md
# node-red-contrib-sun-position
#### 0.5.3: BugFix
- general
- fix for #68
#### 0.5.2: BugFix

@@ -4,0 +9,0 @@

78

nodes/position-config.js

@@ -263,6 +263,23 @@ /********************************************

});
const nowTs = now.getTime();
const nowTs = now.getTime() + 300; // offset to get really next
let last = sortable[0];
if (last.ts > nowTs) {
return [result['nadir'], last];
if (last.ts >= nowTs) {
return {
next : {
value : new Date(result['nadir'].value),
name : result['nadir'].name,
index : result['nadir'].index,
pos : result['nadir'].pos,
valid : result['nadir'].valid,
elevation : result['nadir'].elevation
},
last : {
value : new Date(last.value),
name : last.name,
index : last.index,
pos : last.pos,
valid : last.valid,
elevation : last.elevation
}
};
}

@@ -273,3 +290,20 @@ for (let index = 1; index < sortable.length; index++) {

if (element.ts > nowTs) {
return [last, element];
return {
next : {
value : new Date(element.value),
name : element.name,
index : element.index,
pos : element.pos,
valid : element.valid,
elevation : element.elevation
},
last : {
value : new Date(last.value),
name : last.name,
index : last.index,
pos : last.pos,
valid : last.valid,
elevation : last.elevation
}
};
}

@@ -279,3 +313,20 @@ last = element;

}
return [last, sortable[0]];
return {
next : {
value : new Date(sortable[0].value),
name : sortable[0].name,
index : sortable[0].index,
pos : sortable[0].pos,
valid : sortable[0].valid,
elevation : sortable[0].elevation
},
last : {
value : new Date(last.value),
name : last.name,
index : last.index,
pos : last.pos,
valid : last.valid,
elevation : last.elevation
}
};
}

@@ -475,3 +526,13 @@ /*******************************************************************************************************/

} else if (data.type === 'pdsTimeNow') {
return Object.assign({}, this.getSunTimePrevNext(now));
result = Object.assign({}, this.getSunTimePrevNext(now));
const offsetX = this.getFloatProp(_srcNode, msg, data.offsetType, data.offset, 0, data.offsetCallback, data.noOffsetError);
result.next.value = hlp.normalizeDate(result.next.value, offsetX, data.multiplier, data.next, data.days);
if (data.format > 0) {
return hlp.getFormattedDateOut(result.next, data.format, (this.tzOffset === 0), this.tzOffset);
}
if (this.tzOffset) {
result.prev.value = hlp.convertDateTimeZone(result.prev.value, this.tzOffset).getTime();
result.next.value = hlp.convertDateTimeZone(result.next.value, this.tzOffset).getTime();
}
return result;
} else if (data.type === 'entered' || data.type === 'dateEntered') {

@@ -588,3 +649,6 @@ result = hlp.getDateOfText(String(data.value), (this.tzOffset === 0), this.tzOffset);

} else if (data.type === 'pdsTimeNow') {
return this.getSunTimePrevNext(now)[1];
result = this.getSunTimePrevNext(now).next;
result.fix = true;
const offsetX = this.getFloatProp(_srcNode, msg, data.offsetType, data.offset, 0, data.offsetCallback, data.noOffsetError);
result.value = hlp.addOffset(result.value, offsetX, data.multiplier, data.next); // , data.days);
} else if (data.type === 'str') {

@@ -591,0 +655,0 @@ result.fix = true;

2

package.json
{
"name": "node-red-contrib-sun-position",
"version": "0.5.2",
"version": "0.5.3",
"description": "NodeRED nodes to get sun and moon position",

@@ -5,0 +5,0 @@ "keywords": [

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