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.5.4 to 1.0.0-alpha-1

nodes/clock-timer.html

2

CHANGELOG.md
# node-red-contrib-sun-position
#### 0.5.3: BugFix
#### 0.5.3 + 0.5.4: BugFix

@@ -5,0 +5,0 @@ - general

@@ -53,2 +53,5 @@ {

"oversteer2BlindPos": "Rollladenposition",
"oversteer3Value": "Übersteuerung zus.",
"oversteer3Threshold": "Schwelle",
"oversteer3BlindPos": "Rollladenposition",
"smoothTime": "glätten",

@@ -65,3 +68,5 @@ "showEnhSettings": "Erweiterte Einstellungen",

"btnClear": "leeren",
"dialogtitle":"Regel bearbeiten"
"dialogtitle":"Regel bearbeiten",
"autoTrigger":"automatisch triggern",
"autoTrigger2":"Neuberechnung nach dynamischer Zeit"
},

@@ -80,3 +85,3 @@ "placeholder": {

"sunControlMode": "wähle wie die Sonnensteuerung arbeiten soll",
"OverwriteExpire": "(opt) Dauer nasch der eine manuelle Einstellung verfällt",
"overwriteExpire": "(opt) Dauer nasch der eine manuelle Einstellung verfällt",
"sunFloorLength": "das Ausmaß, in dem direktes Sonnenlicht durch das Fenster in den Raum gelangen darf, definiert als Länge am Boden",

@@ -98,3 +103,5 @@ "sunMinAltitude": "(opt) minimaler Höhenwinkel der Sonne",

"offset":"Zeit offset",
"level": "Behanghöhe"
"level": "Behanghöhe",
"autoTrigger":"automatisches triggern der Neuberechnung der Rollladenposition nach einer dynamischen Zeitspanne"
},

@@ -101,0 +108,0 @@ "text": {

@@ -53,2 +53,5 @@ {

"oversteer2BlindPos": "blind position",
"oversteer3Value": "oversteer add",
"oversteer3Threshold": "Threshold",
"oversteer3BlindPos": "blind position",
"smoothTime": "smoothTime",

@@ -65,3 +68,5 @@ "showEnhSettings": "Enhanced settings",

"btnClear": "clear",
"dialogtitle":"Edit Rule"
"dialogtitle":"Edit Rule",
"autoTrigger":"auto trigger",
"autoTrigger2":"recalculate every x minutes"
},

@@ -80,3 +85,3 @@ "placeholder": {

"sunControlMode": "select if sun control is active and how it should working",
"OverwriteExpire": "(opt) the duration a manual setting will remain",
"overwriteExpire": "(opt) the duration a manual setting will remain",
"sunFloorLength": "(opt) the extent to which direct sunlight is to be allowed into the room through the window, defined as a length on the floor",

@@ -98,3 +103,4 @@ "sunMinAltitude": "(opt) minimum altitude of the sun for determination of blind position",

"offset":"time offset",
"level": "level"
"level": "level",
"autoTrigger":"automatic triggers new calculation of the blind position in a dynamic changing time interval"
},

@@ -101,0 +107,0 @@ "text": {

@@ -29,2 +29,6 @@ {

"suninsky":"sun in the sky (percent)",
"sunAzimuth":"Azimuth of sun",
"sunElevation":"Elevation of sun",
"sunAzimuthRad":"Azimuth of sun (rad)",
"sunElevationRad":"Elevation of sun (rad)",
"suntime":"sun time",

@@ -38,3 +42,3 @@ "suntimes":"sun times",

"levelND": "N/D - use default, sun control or reset",
"PlTRes":"msg.payload if topic contains \"__value__\""
"PlTRes":"msg.payload if topic contains"
},

@@ -87,3 +91,4 @@ "typeOptions": {

"lastQuarterMoon": "Last Quarter 🌗",
"waningCrescentMoon": "Waning Crescent 🌘"
"waningCrescentMoon": "Waning Crescent 🌘",
"PlTRes":"msg.payload if topic contains \"__topic__\""
},

@@ -90,0 +95,0 @@ "multiselectLbl": {

@@ -537,11 +537,8 @@ /********************************************

result = Object.assign({}, this.getSunTimePrevNext(now));
_srcNode.debug(`getOutDataProp 1 result=${util.inspect(result, { colors: true, compact: 10, breakLength: Infinity }) }`);
const offsetX = this.getFloatProp(_srcNode, msg, data.offsetType, data.offset, 0, data.offsetCallback, data.noOffsetError);
result.last.value = hlp.normalizeDate(result.last.value, offsetX, data.multiplier, data.next, data.days);
result.next.value = hlp.normalizeDate(result.next.value, offsetX, data.multiplier, data.next, data.days);
_srcNode.debug(`getOutDataProp 2 result=${util.inspect(result, { colors: true, compact: 10, breakLength: Infinity }) }`);
if (this.tzOffset) {
result.last.value = hlp.convertDateTimeZone(result.last.value, this.tzOffset).getTime();
result.next.value = hlp.convertDateTimeZone(result.next.value, this.tzOffset).getTime();
_srcNode.debug(`getOutDataProp 3 result=${util.inspect(result, { colors: true, compact: 10, breakLength: Infinity }) }`);
}

@@ -607,3 +604,3 @@ return result;

result.error = 'No valid Days given!';
} else if (data.type === '' || data.type === 'none' || data.type === null) {
} else if (data.type === '' || data.type === 'none' || data.type === null || typeof data.type === 'undefined') {
result.error = 'wrong type "' + data.type + '"="' + data.value+'"';

@@ -632,3 +629,3 @@ } else if (data.type === 'date') {

result.value = hlp.getTimeOfText(String(data.value), now, (this.tzOffset === 0), this.tzOffset);
if (result.value !== null) {
if (result.value !== null && typeof result.value !== 'undefined') {
const offsetX = this.getFloatProp(_srcNode, msg, data.offsetType, data.offset, 0, data.offsetCallback, data.noOffsetError);

@@ -640,3 +637,3 @@ result.value = hlp.normalizeDate(result.value, offsetX, data.multiplier, data.next, data.days);

result.value = hlp.getDateOfText(String(data.value), (this.tzOffset === 0), this.tzOffset);
if (result.value !== null) {
if (result.value !== null && typeof result.value !== 'undefined') {
const offsetX = this.getFloatProp(_srcNode, msg, data.offsetType, data.offset, 0, data.offsetCallback, data.noOffsetError);

@@ -731,6 +728,6 @@ result.value = hlp.normalizeDate(result.value, offsetX, data.multiplier, data.next, data.days);

getPropValue(_srcNode, msg, data) {
// _srcNode.debug(`getPropValue ${data.type}.${data.value} (${data.addID})`);
let result = null;
_srcNode.debug(`getPropValue ${data.type}.${data.value} (${data.addID}) - data= ${util.inspect(data, { colors: true, compact: 10, breakLength: Infinity })}`);
let result = undefined;
if (data.type === '' || data.type === 'none' || typeof data.type === 'undefined' || data.type === null) {
result = null;
result = undefined;
} else if (data.type === 'num') {

@@ -753,6 +750,6 @@ result = Number(data.value);

} else if (data.type === 'PlT') {
if (msg.topic && msg.value && msg.topic.includes(msg.value)) {
if (msg.topic && data.value && msg.topic.includes(data.value)) {
result = msg.payload;
} else {
result = null;
result = undefined;
}

@@ -763,2 +760,10 @@ } else if (data.type === 'pdsCalcData') {

result = this.getSunInSky(msg.ts);
} else if (data.type === 'pdsCalcAzimuth') {
result = this.getSunCalc(msg.ts, false, false).azimuthDegrees;
} else if (data.type === 'pdsCalcElevation') {
result = this.getSunCalc(msg.ts, false, false).altitudeDegrees;
} else if (data.type === 'pdsCalcAzimuthRad') {
result = this.getSunCalc(msg.ts, false, false).azimuthRadians;
} else if (data.type === 'pdsCalcElevationRad') {
result = this.getSunCalc(msg.ts, false, false).altitudeRadians;
} else if (data.type === 'pdmCalcData') {

@@ -781,8 +786,9 @@ result = this.getMoonCalc(msg.ts, true);

if (typeof data.callback === 'function') {
_srcNode.debug('getPropValue result=' + util.inspect(result, { colors: true, compact: 10, breakLength: Infinity }) + ' - ' + typeof result);
return data.callback(result, data);
} else if (result === null || typeof result === 'undefined') {
_srcNode.error(RED._('errors.error', { message: RED._('errors.notEvaluableProperty', data) }) );
return null;
return undefined;
}
// _srcNode.debug('getPropValue result=' + util.inspect(result, { colors: true, compact: 10, breakLength: Infinity }) + ' - ' + typeof result);
_srcNode.debug('getPropValue result=' + util.inspect(result, { colors: true, compact: 10, breakLength: Infinity }) + ' - ' + typeof result);
return result;

@@ -792,3 +798,3 @@ }

comparePropValue(_srcNode, msg, opTypeA, opValueA, compare, opTypeB, opValueB, opCallback) { // eslint-disable-line complexity
// _srcNode.debug(`getComparablePropValue opTypeA='${opTypeA}' opValueA='${opValueA}' compare='${compare}' opTypeB='${opTypeB}' opValueB='${opValueB}'`);
_srcNode.debug(`getComparablePropValue opTypeA='${opTypeA}' opValueA='${opValueA}' compare='${compare}' opTypeB='${opTypeB}' opValueB='${opValueB}'`);
if (opTypeA === 'none' || opTypeA === '' || typeof opTypeA === 'undefined' || opTypeA === null) {

@@ -795,0 +801,0 @@ return false;

@@ -184,3 +184,3 @@ /************************************************************************/

value: 'PlT',
label: 'msg.payload if topic contains',
label: node._('node-red-contrib-sun-position/position-config:common.types.PlTRes'),
hasValue: true

@@ -351,2 +351,26 @@ },

},
SunAzimuth: {
value: 'pdsCalcAzimuth',
label: node._('node-red-contrib-sun-position/position-config:common.types.sunAzimuth','Azimuth'),
icon: 'icons/node-red-contrib-sun-position/inputTypeSunAzimuth.png',
hasValue: false
},
SunElevation: {
value: 'pdsCalcElevation',
label: node._('node-red-contrib-sun-position/position-config:common.types.sunElevation','Elevation'),
icon: 'icons/node-red-contrib-sun-position/inputTypeSunElevation.png',
hasValue: false
},
SunAzimuthRad: {
value: 'pdsCalcAzimuthRad',
label: node._('node-red-contrib-sun-position/position-config:common.types.sunAzimuthRad','Azimuth'),
icon: 'icons/node-red-contrib-sun-position/inputTypeSunAzimuth.png',
hasValue: false
},
SunElevationRad: {
value: 'pdsCalcElevationRad',
label: node._('node-red-contrib-sun-position/position-config:common.types.sunElevationRad','Elevation'),
icon: 'icons/node-red-contrib-sun-position/inputTypeSunElevation.png',
hasValue: false
},
MoonCalc: {

@@ -353,0 +377,0 @@ value: 'pdmCalcData',

@@ -28,4 +28,7 @@ /********************************************

if (node.positionConfig === null ||
typeof node.positionConfig === 'undefined' ||
config.operator === null ||
config.inputType === null) {
typeof config.operator === 'undefined' ||
config.inputType === null ||
typeof config.inputType === 'undefined') {
node.status({

@@ -70,3 +73,3 @@ fill: 'red',

if (resultObj === null) {
if (resultObj === null || typeof resultObj === 'undefined') {
throw new Error('could not evaluate ' + config.result1ValueType + '.' + config.result1Value);

@@ -73,0 +76,0 @@ } else if (resultObj.error) {

@@ -194,3 +194,3 @@ /********************************************

if ((node.nextTime !== null) && (errorStatus === '')) {
if ((node.nextTime !== null) && (typeof node.nextTime !== undefined) && (errorStatus === '')) {
if (!hlp.isValidDate(node.nextTime)) {

@@ -469,3 +469,3 @@ hlp.handleError(this, 'Invalid time format', undefined, 'internal error!');

const node = RED.nodes.getNode(req.params.id);
if (node !== null) {
if (node !== null && typeof node !== 'undefined') {
try {

@@ -472,0 +472,0 @@ node.receive();

@@ -278,4 +278,7 @@ /********************************************

if (node.positionConfig === null ||
typeof node.positionConfig === 'undefined' ||
config.operand1Type === null ||
config.operand2Type === null) {
typeof config.operand1Type === 'undefined' ||
config.operand2Type === null ||
typeof config.operand2Type === 'undefined') {
node.status({

@@ -353,3 +356,3 @@ fill: 'red',

if (resultObj === null) {
if (resultObj === null || typeof resultObj === 'undefined') {
throw new Error('could not evaluate ' + config.result1ValueType + '.' + config.result1Value);

@@ -356,0 +359,0 @@ } else if (resultObj.error) {

{
"name": "node-red-contrib-sun-position",
"version": "0.5.4",
"version": "1.0.0-alpha-1",
"description": "NodeRED nodes to get sun and moon position",

@@ -84,9 +84,10 @@ "keywords": [

"position-config": "nodes/position-config.js",
"sun-position": "nodes/sun-position.js",
"moon-position": "nodes/moon-position.js",
"time-inject": "nodes/time-inject.js",
"within-time-switch": "nodes/within-time-switch.js",
"time-inject": "nodes/time-inject.js",
"clock-timer": "nodes/clock-timer.js",
"time-comp": "nodes/time-comp.js",
"time-span": "nodes/time-span.js",
"blind-control": "nodes/blind-control.js"
"blind-control": "nodes/blind-control.js",
"sun-position": "nodes/sun-position.js",
"moon-position": "nodes/moon-position.js"
}

@@ -93,0 +94,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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