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 1.0.0-alpha-7 to 1.0.0-alpha-8

21

CHANGELOG.md
# node-red-contrib-sun-position
#### 1.0.0: mayor release

@@ -9,14 +8,24 @@

- it is ideal for dimmers, Christmas lights, ...
- time-inject
- added month selection
- added even/odd day selection
- within-time
- added day selection
- added month selection
- added even/odd day selection
- blind control
- added possibility to limit rules for several days
- added validation of rules (shows a hint if a rule in invalid)
- added day selection to rules
- added month selection to rules
- added even/odd day selection for rules
- added auto Trigger capability
- general
- added on several settings the possibility to use payload if the topic of an incoming message contains special value.
- fixed smaller problems
- blind-control
- added possibility to limit rules for several days
- added validation of rules (shows a hint if a rule in invalid)
- The big jump in the version number is not due to the amount change, but rather otherwise.
- The big jump in the version number is not only due to the amount change, but rather otherwise.
- The Version starting with 1... will show that this node is tested and working with Node-Red above 1...
- After this release, no major changes are planned in the next time and the node is for the time being feature complete. This fits a version number 1.. better than 0..
#### 0.5.3 + 0.5.4: BugFix

@@ -23,0 +32,0 @@

@@ -16,3 +16,2 @@ /********************************************

const cRuleLogOperatorOr = 1;
const cautoTriggerTime = 20 * 60000;

@@ -471,8 +470,6 @@ /******************************************************************************************/

}
if (rule.timeBanOddDays && (dateNr % 2 !== 0)) {
// odd
if (rule.timeOnlyOddDays && (dateNr % 2 === 0)) { // even
return null;
}
if (rule.timeBanEvenDays && (dateNr % 2 === 0)) {
// even
if (rule.timeOnlyEvenDays && (dateNr % 2 !== 0)) { // odd
return null;

@@ -531,4 +528,4 @@ }

const diff = ruleSel.timeData.ts - nowNr;
node.autoTriggerTime = Math.min(node.autoTriggerTime, diff);
node.autoTriggerType = 1;
node.autoTrigger.time = Math.min(node.autoTrigger.time, diff);
node.autoTrigger.type = 1;
} else {

@@ -543,4 +540,4 @@ for (let i = (ruleindex+1); i < node.rules.count; ++i) {

const diff = num - nowNr;
node.autoTriggerTime = Math.min(node.autoTriggerTime, diff);
node.autoTriggerType = 2;
node.autoTrigger.time = Math.min(node.autoTrigger.time, diff);
node.autoTrigger.type = 2;
}

@@ -626,4 +623,8 @@ }

this.outputs = Number(config.outputs || 1);
this.autoTrigger = config.autoTrigger || false;
this.autoTriggerObj = null;
if (config.autoTrigger) {
this.autoTrigger = {
deaultTime : config.autoTriggerTime || 20 * 60000
};
this.autoTriggerObj = null;
}
const node = this;

@@ -723,4 +724,4 @@

if (node.autoTrigger) {
node.autoTriggerTime = cautoTriggerTime;
node.autoTriggerType = 0;
node.autoTrigger.time = node.autoTrigger.deaultTime;
node.autoTrigger.type = 0;
}

@@ -730,3 +731,5 @@

let ruleId = -2;
const timeCtrl = {};
const timeCtrl = {
autoTrigger : node.autoTrigger
};
// node.debug(`start pos=${node.payload.current} manual=${node.timeClockData.overwrite.active} reasoncode=${node.reason.code} description=${node.reason.description}`);

@@ -780,3 +783,3 @@ // check for manual overwrite

if (node.autoTrigger) {
node.debug('------------- autotrigger ---------------- ' + node.autoTriggerTime + ' - ' + node.autoTriggerType);
node.debug('------------- autotrigger ---------------- ' + node.autoTrigger.time + ' - ' + node.autoTrigger.type);
if (node.autoTriggerObj) {

@@ -793,3 +796,3 @@ clearTimeout(node.autoTriggerObj);

});
}, node.autoTriggerTime);
}, node.autoTrigger.time);
}

@@ -799,3 +802,2 @@ done();

} catch (err) {
// node.error(RED._('clock-timer.errors.error', err));
node.log(util.inspect(err, Object.getOwnPropertyNames(err)));

@@ -805,5 +807,5 @@ node.status({

shape: 'ring',
text: 'internal error'
text: 'internal error: ' + err.message
});
done(RED._('clock-timer.errors.error', err), msg);
done(RED._('node-red-contrib-sun-position/position-config:errors.error', err), msg);
}

@@ -914,2 +916,7 @@ return null;

if (rule.timeOnlyOddDays && rule.timeOnlyEvenDays) {
rule.timeOnlyOddDays = false;
rule.timeOnlyEvenDays = false;
}
if (rule.conditional) {

@@ -916,0 +923,0 @@ rule.conditonData = [{

@@ -10,3 +10,3 @@ {

"windowBottom": "Fenster Unterseite",
"windowAzimuthStart":"Start",
"windowAzimuthStart": "Start",
"windowAzimuthEnd": "Ende",

@@ -46,4 +46,4 @@ "blindIncrement": "Schritt",

"sunMinDelta": "Mindeständerung",
"time":"Zeit",
"name":"name",
"time": "Zeit",
"name": "name",
"oversteerValue": "Übersteuerung",

@@ -61,5 +61,5 @@ "oversteerThreshold": "Schwelle",

"outputs": "Ausgänge",
"offset":"Zeit offset",
"offset-timeMin":"früheste (min) offset",
"offset-timeMax":"späteste (max) offset",
"offset": "Zeit offset",
"offset-timeMin": "früheste (min) offset",
"offset-timeMax": "späteste (max) offset",
"singleOutput": "einzeln (1)",

@@ -70,5 +70,12 @@ "splitOutput": "doppelt (2)",

"btnClear": "leeren",
"dialogtitle":"Regel bearbeiten",
"autoTrigger":"automatisch triggern",
"autoTrigger2":"Neuberechnung nach dynamischer Zeit"
"dialogtitle": "Regel bearbeiten",
"autoTrigger": "automatisch triggern",
"autoTrigger2": "dynamisch aber max aller",
"validForDays": "gültige Tage",
"validForMonths": "gültige Monate",
"specialDays": "spezielle tage",
"onlyEven": "nur gerade",
"onlyOdd": "nur ungerade",
"onlyEvenDays": "nur gerade Tage",
"onlyOddDays": "nur ungerade Tage"
},

@@ -94,3 +101,3 @@ "placeholder": {

"oversteerBlindPos": "Position wenn der Vergleich zutrifft",
"smoothTime":"(opt) verhindert Änderungen durch Sonnenstandsänderung innerhalb der angegebenen Zeit",
"smoothTime": "(opt) verhindert Änderungen durch Sonnenstandsänderung innerhalb der angegebenen Zeit",
"name": "Name",

@@ -102,7 +109,7 @@ "expiryperiod": "120",

"btnClear": "alle Regeln entfernen",
"condoperand":"operand",
"time":"Zeit",
"offset":"Zeit offset",
"condoperand": "operand",
"time": "Zeit",
"offset": "Zeit offset",
"level": "Behanghöhe",
"autoTrigger":"automatisches triggern der Neuberechnung der Rollladenposition nach einer dynamischen Zeitspanne"
"autoTrigger": "automatisches triggern der Neuberechnung der Rollladenposition nach einer dynamischen Zeitspanne"

@@ -113,3 +120,3 @@ },

"time": "Zeitsteuerung: Es werden nur Zeilen ausgewertet, bei denen die Eigenschaft <b>nicht verwendet</b> oder <em>true</em> ist. <br> <b>bis</b>: Die erste übereinstimmende Zeile wird verwendet, wobei die definierte Zeit <b>nicht verwendet</b> oder größer als <b>now</b> ist. <br> <b>von</b>: Die letzte übereinstimmende Zeile wird verwendet, wo die angegebene Zeit <b>nicht verwendet</b> oder weniger als <b>der aktuelle Zeitpunkt</b> ist. <br>",
"blindLevelDefault":"Wenn keine Regel zutrifft, wird die aktuelle Rollladenposition genutzt. Bei beschränkender Sonnen-Steuerung ist die die Rollladenposition, wenn die Sonne nicht in das Fenster scheint.",
"blindLevelDefault": "Wenn keine Regel zutrifft, wird die aktuelle Rollladenposition genutzt. Bei beschränkender Sonnen-Steuerung ist die die Rollladenposition, wenn die Sonne nicht in das Fenster scheint.",
"overwrite": "manuelles Überschreiben der Rollladenposition",

@@ -121,3 +128,3 @@ "sunControlNotActive": "Nur Regelbasiert",

"oversteer": "erlaubt das Übersteuern der Position in Abhängigkeit von der Sonne unter definierten Bedingungen wie Wetter (z. B. Wolkenhimmel, Beleuchtung, etc.)",
"sunControlMaximization":"<ul><li>Wenn keine Regel oder Überschreiben (Override) zutrifft,<ul><li>Wenn die Sonne <em>nicht</ em> in das Fenster scheint, wird die Rollladenhöhe die definierte <strong>Minimalposition</ strong> gesetzt. (Übersteuern wird ignoriert)</ li><li>Wenn sich die Sonne im Fenster befindet</ li><li>Wenn eine Übersteueruzng aufgesetzt ist und die bedingung zutrifft, wird der Behang auf die Höhe des Übersteuerns gesetzt.< / li><li>Andernfalls wird die Behanghöhe auf die definierte <strong>Maximalposition</ strong> gesetzt.</ li></ ul></ li></ ul>",
"sunControlMaximization": "<ul><li>Wenn keine Regel oder Überschreiben (Override) zutrifft,<ul><li>Wenn die Sonne <em>nicht</ em> in das Fenster scheint, wird die Rollladenhöhe die definierte <strong>Minimalposition</ strong> gesetzt. (Übersteuern wird ignoriert)</ li><li>Wenn sich die Sonne im Fenster befindet</ li><li>Wenn eine Übersteueruzng aufgesetzt ist und die bedingung zutrifft, wird der Behang auf die Höhe des Übersteuerns gesetzt.< / li><li>Andernfalls wird die Behanghöhe auf die definierte <strong>Maximalposition</ strong> gesetzt.</ li></ ul></ li></ ul>",
"sunControlRestriction": "Wenn keine Regel oder Überschreiben (Override) zutrifft, berechnet der Knoten die entsprechende Blindposition, um die Menge des direkten Sonnenlichts, das in den Raum fällt, zu begrenzen.",

@@ -177,3 +184,3 @@ "sunCtrlLoF": "Definition inwieweit direktes Sonnenlicht durch das Fenster in den Raum gelangen darf (als Länge auf dem Boden).",

"smooth": "Änderung zu __pos__ verhindert",
"sunInWinMax":"Sonne scheint ins Fenster (max)",
"sunInWinMax": "Sonne scheint ins Fenster (max)",
"sunNotInWinMin": "Sonne scheint nicht ins Fenster (min)",

@@ -192,3 +199,3 @@ "ruleMin": "__org__ [min rule __number__]",

"getPropertyData": "Fehler bei der Ermittlung der Bedingung: \"__message__\" skipping time",
"smoothTimeToolong":"Die gewählte zeit ist zu groß!!",
"smoothTimeToolong": "Die gewählte zeit ist zu groß!!",
"usingTempValue": "Wert von __type__.__value__ kann nicht ermitteln werden und es wird der gespeicherte Wert \"__usedValue__\" verwendet!",

@@ -195,0 +202,0 @@ "notEvaluableProperty": "kann den Wert von __type__.__value__ nicht ermitteln, verwende \"__usedValue__\"!"

@@ -43,3 +43,3 @@ {

"autoTrigger":"automatisch triggern",
"autoTrigger2":"Neuberechnung nach dynamischer Zeit"
"autoTrigger2":"dynamisch aber max aller"
},

@@ -46,0 +46,0 @@ "placeholder": {

{
"blind-control": {
"label": {
"blind-control":"blind-control",
"blind-control": "blind-control",
"blind-control-palette": "blind",
"output1":"new blind level",
"output1": "new blind level",
"output2": "state object",
"windowTop": "window top",
"windowBottom": "window bottom",
"windowAzimuthStart":"start",
"windowAzimuthStart": "start",
"windowAzimuthEnd": "end",

@@ -30,4 +30,4 @@ "blindIncrement": "Increment",

"ruleTimeMin": "at the earliest (min)",
"ruleTimeDays":"only on day",
"ruleTimeMonths":"only on month",
"ruleTimeDays": "only on day",
"ruleTimeMonths": "only on month",
"ruleDescription": "Description",

@@ -48,4 +48,4 @@ "ruleBlindLevel": "blind position",

"sunMinDelta": "min delta",
"time":"time",
"name":"name",
"time": "time",
"name": "name",
"oversteerValue": "oversteer",

@@ -63,5 +63,5 @@ "oversteerThreshold": "Threshold",

"outputs": "Outputs",
"offset":"time offset",
"offset-timeMin":"earliest (min) offset",
"offset-timeMax":"latest (max) offset",
"offset": "time offset",
"offset-timeMin": "earliest (min) offset",
"offset-timeMax": "latest (max) offset",
"singleOutput": "single (1)",

@@ -72,12 +72,12 @@ "splitOutput": "dual (2)",

"btnClear": "clear",
"dialogtitle":"Edit Rule",
"autoTrigger":"auto trigger",
"autoTrigger2":"recalculate every x minutes",
"validForDays":"valid days",
"validForMonths":"valid months",
"banDays":"ban days",
"banEvenDays":"even",
"banOddDays":"odd",
"onlyEvenDays":"only even days",
"onlyOddDays":"only odd days"
"dialogtitle": "Edit Rule",
"autoTrigger": "auto trigger",
"autoTrigger2": "dynamic, but max every",
"validForDays": "valid days",
"validForMonths": "valid months",
"specialDays": "special days",
"onlyEven": "only even",
"onlyOdd": "only odd",
"onlyEvenDays": "only even days",
"onlyOddDays": "only odd days"
},

@@ -103,3 +103,3 @@ "placeholder": {

"oversteerBlindPos": "blind position when the compare be the case",
"smoothTime":"(opt) prevents changes due to sun in the given time",
"smoothTime": "(opt) prevents changes due to sun in the given time",
"name": "Name",

@@ -111,9 +111,9 @@ "expiryperiod": "120",

"btnClear": "removes all rules from list",
"condoperand":"operand",
"time":"time",
"offset":"time offset",
"condoperand": "operand",
"time": "time",
"offset": "time offset",
"level": "level",
"ruleTimeDays": "select days wherefore it should be valid",
"ruleTimeMonths": "select months wherefore it should be valid",
"autoTrigger":"automatic triggers new calculation of the blind position in a dynamic changing time interval"
"autoTrigger": "automatic triggers new calculation of the blind position in a dynamic changing time interval"
},

@@ -123,3 +123,3 @@ "text": {

"time": "Time control:Only rows will be evaluated, where property is <b>not used</b> or matches the selected value. <br><b>until</b>:The first matching line will used, where defined time is <b>not used</b> or greater than <b>now</b>.<br><b>from</b>:The last matching line will used, where defined time is <b>not used</b> or less than <b>now</b>.<br>",
"blindLevelDefault":"if no rule matches the following position will be used, On sun light restriction this is the blind level wenn sun is not in the window.",
"blindLevelDefault": "if no rule matches the following position will be used, On sun light restriction this is the blind level wenn sun is not in the window.",
"overwrite": "manual overwrite of the blind position",

@@ -131,3 +131,3 @@ "sunControlNotActive": "Only rule control",

"oversteer": "allows to oversteer the position depending on the sun under defined condition such as weather (for example sky covered by clouds, lighting, ...)",
"sunControlMaximization":"<ul><li>If no rule or override matches<ul><li>If the sun is <em>not</em> in the window the blind will set to defined <strong>min position</strong>. (oversteer will be ignored)</li><li>If the sun is in the window</li><li>If any oversteer data are setup and oversteer conditions are fulfilled the blind will set to the defined oversteer blind position.</li><li>otherwise the blind level is set to defined <strong>max position</strong>.</li></ul></li></ul>",
"sunControlMaximization": "<ul><li>If no rule or override matches<ul><li>If the sun is <em>not</em> in the window the blind will set to defined <strong>min position</strong>. (oversteer will be ignored)</li><li>If the sun is in the window</li><li>If any oversteer data are setup and oversteer conditions are fulfilled the blind will set to the defined oversteer blind position.</li><li>otherwise the blind level is set to defined <strong>max position</strong>.</li></ul></li></ul>",
"sunControlRestriction": "If no rule or override matches, the node calculates the appropriate blind position to restrict the amount of direct sunlight entering the room.",

@@ -187,3 +187,3 @@ "sunCtrlLoF": "The limit to what extent direct sunlight is to be allowed into the room through the window, defined as a length on the floor.",

"smooth": "block change to __pos__",
"sunInWinMax":"Sun in window (max)",
"sunInWinMax": "Sun in window (max)",
"sunNotInWinMin": "Sun not in window (min)",

@@ -194,3 +194,2 @@ "ruleMin": "__org__ [min rule __number__]",

"errors": {
"error": "Error: __message__",
"warning": "Warning: __message__",

@@ -203,3 +202,3 @@ "internal": "Error: __message__",

"getPropertyData": "error getting condition data: \"__message__\" skipping time",
"smoothTimeToolong":"The selected smooth is too long!!",
"smoothTimeToolong": "The selected smooth is too long!!",
"usingTempValue": "Could not evaluate __type__.__value__ and using stored value \"__usedValue__\"!",

@@ -206,0 +205,0 @@ "notEvaluableProperty": "could not evaluate __type__.__value__, using \"__usedValue__\"!"

{
"clock-timer": {
"label": {
"clock-timer":"clock-timer",
"clock-timer": "clock-timer",
"clock-timer-palette": "clock timer",
"output1":"payload based on rule",
"output1": "payload based on rule",
"output2": "state object",

@@ -23,8 +23,8 @@ "payloadDefault": "payload",

"ruleTimeMin": "at the earliest (min)",
"ruleTimeDays":"only on day",
"ruleTimeDays": "only on day",
"ruleTimeMonths": "only on month",
"ruleDescription": "Description",
"rulePayload": "Payload:",
"rulePayload": "Payload: ",
"rulePayloadND": "No Payload",
"ruleTopic": "Topic:",
"ruleTopic": "Topic: ",
"time": "time",

@@ -42,12 +42,12 @@ "name": "name",

"btnClear": "clear",
"dialogtitle":"Edit Rule",
"autoTrigger":"auto trigger",
"autoTrigger2":"recalculate every x minutes",
"validForDays":"valid days",
"validForMonths":"valid months",
"banDays":"ban days",
"banEvenDays":"even",
"banOddDays":"odd",
"onlyEvenDays":"only even days",
"onlyOddDays":"only odd days"
"dialogtitle": "Edit Rule",
"autoTrigger": "auto trigger",
"autoTrigger2": "dynamic, but max every",
"validForDays": "valid days",
"validForMonths": "valid months",
"specialDays": "special days",
"onlyEven": "even",
"onlyOdd": "odd",
"onlyEvenDays": "only even days",
"onlyOddDays": "only odd days"
},

@@ -65,13 +65,13 @@ "placeholder": {

"btnClear": "removes all rules from list",
"condoperand":"operand",
"time":"time",
"offset":"time offset",
"condoperand": "operand",
"time": "time",
"offset": "time offset",
"level": "level",
"ruleTimeDays": "select days wherefore it should be valid",
"ruleTimeMonths": "select months wherefore it should be valid",
"autoTrigger":"automatic triggers new calculation of the rule in a dynamic changing time interval"
"autoTrigger": "automatic triggers new calculation of the rule in a dynamic changing time interval"
},
"text": {
"time": "Time control:Only rows will be evaluated, where property is <b>not used</b> or matches the selected value. <br><b>until</b>:The first matching line will used, where defined time is <b>not used</b> or greater than <b>now</b>.<br><b>from</b>:The last matching line will used, where defined time is <b>not used</b> or less than <b>now</b>.<br>",
"payloadDefault":"if no rule matches the following payload will be used.",
"payloadDefault": "if no rule matches the following payload will be used.",
"overwrite": "manual overwrite of the rule payload"

@@ -105,3 +105,2 @@ },

"errors": {
"error": "Error: __message__",
"warning": "Warning: __message__",

@@ -108,0 +107,0 @@ "internal": "Error: __message__",

@@ -5,2 +5,3 @@ {

"positionConfig": "configuration",
"infoText":"The configuration must be created and deployed for the settings page to work properly.",
"binary": "binary",

@@ -7,0 +8,0 @@ "json": "json",

@@ -38,5 +38,5 @@ {

"validForMonths":"valid months",
"banDays":"ban days",
"banEvenDays":"even",
"banOddDays":"odd",
"specialDays":"special days",
"onlyEvenDays":"only even",
"onlyOddDays":"only odd",
"fewDays": "few days",

@@ -43,0 +43,0 @@ "fewMonths": "few months"

@@ -36,5 +36,5 @@ {

"validForMonths":"valid months",
"banDays":"ban days",
"banEvenDays":"even",
"banOddDays":"odd"
"specialDays":"special days",
"onlyEvenDays":"only even",
"onlyOddDays":"only odd"
},

@@ -65,6 +65,6 @@ "placeholder": {

"invalid-month": "Month is not selected.",
"banned-odd-day": "Not an even Day!",
"banned-even-day": "Not an odd Day!"
"only-odd-day": "Not an odd Day!",
"only-even-day": "Not an even Day!"
}
}
}

@@ -118,3 +118,3 @@ /********************************************

shape: 'ring',
text: 'internal error'
text: 'internal error: ' + err.message
});

@@ -121,0 +121,0 @@ done('internal error moon-position:' + err.message, msg);

@@ -187,3 +187,3 @@ /********************************************

shape: 'ring',
text: 'internal error'
text: 'internal error: ' + err.message
});

@@ -190,0 +190,0 @@ done('internal error sun-position:' + err.message, msg);

@@ -22,3 +22,3 @@ /********************************************

this.on('input', (msg, send, done) => { // eslint-disable-line complexity
this.on('input', (msg, send, done) => {
// If this is pre-1.0, 'done' will be undefined

@@ -25,0 +25,0 @@ done = done || function (text, msg) { if (text) { return node.error(text, msg); } return null; };

@@ -91,8 +91,8 @@ /********************************************

this.timeDays = config.timeDays;
this.timeBanOddDays = config.timeBanOddDays;
this.timeBanEvenDays = config.timeBanEvenDays;
this.timeOnlyOddDays = config.timeOnlyOddDays;
this.timeOnlyEvenDays = config.timeOnlyEvenDays;
this.timeMonths = config.timeMonths;
this.timeAltDays = config.timeAltDays;
this.timeAltBanOddDays = config.timeAltBanOddDays;
this.timeAltBanEvenDays = config.timeAltBanEvenDays;
this.timeAltOnlyOddDays = config.timeAltOnlyOddDays;
this.timeAltOnlyEvenDays = config.timeAltOnlyEvenDays;
this.timeAltMonths = config.timeAltMonths;

@@ -112,5 +112,10 @@

}
if (this.timeAltBanEvenDays && this.timeAltBanOddDays) {
throw new Error('No valid days aviable (odd and enven days banned! Please check settings!');
if (this.timeOnlyEvenDays && this.timeOnlyOddDays) {
this.timeOnlyEvenDays = false;
this.timeOnlyOddDays = false;
}
if (this.timeAltOnlyEvenDays && this.timeAltOnlyOddDays) {
this.timeAltOnlyEvenDays = false;
this.timeAltOnlyOddDays = false;
}

@@ -172,4 +177,4 @@ this.offset = config.offset || config.timeOffset || 0;

months : node.timeMonths,
banOddDays: node.timeBanOddDays,
banEvenDays: node.timeBanEvenDays
onlyOddDays: node.timeOnlyOddDays,
onlyEvenDays: node.timeOnlyEvenDays
});

@@ -203,4 +208,4 @@ if (node.nextTimeData.error) {

months : node.timeAltMonths,
banOddDays: node.timeAltBanOddDays,
banEvenDays: node.timeAltBanEvenDays
onlyOddDays: node.timeAltOnlyOddDays,
onlyEvenDays: node.timeAltOnlyEvenDays
});

@@ -226,3 +231,3 @@

hlp.handleError(this, 'Invalid time format', undefined, 'internal error!');
return { state:'error', done: false, statusMsg: 'internal error!', errorMsg: 'Invalid time format'};
return { state:'error', done: false, statusMsg: 'Invalid time format!', errorMsg: 'Invalid time format'};
}

@@ -229,0 +234,0 @@

@@ -272,3 +272,3 @@ /********************************************

this.on('input', (msg, send, done) => { // eslint-disable-line complexity
this.on('input', (msg, send, done) => {
// If this is pre-1.0, 'done' will be undefined

@@ -275,0 +275,0 @@ done = done || function (text, msg) { if (text) { return node.error(text, msg); } return null; };

@@ -138,8 +138,8 @@ /********************************************

const dateNr = now.getDate();
if (config.timeBanOddDays && (dateNr % 2 !== 0)) {
result.warn = RED._('within-time-switch.errors.banned-odd-day');
if (node.timeOnlyOddDays && (dateNr % 2 === 0)) { // even
result.warn = RED._('within-time-switch.errors.only-odd-day');
return result;
}
if (config.timeBanEvenDays && (dateNr % 2 === 0)) {
result.warn = RED._('within-time-switch.errors.banned-even-day');
if (node.timeOnlyEvenDays && (dateNr % 2 !== 0)) { // odd
result.warn = RED._('within-time-switch.errors.only-even-day');
return result;

@@ -294,2 +294,5 @@ }

this.timeOnlyEvenDays = config.timeOnlyEvenDays;
this.timeOnlyOddDays = config.timeOnlyOddDays;
if (config.timeDays === '') {

@@ -301,4 +304,5 @@ throw new Error('No valid days given! Please check settings!');

}
if (config.timeAltBanEvenDays && config.timeAltBanOddDays) {
throw new Error('No valid days aviable (odd and enven days banned! Please check settings!');
if (this.timeOnlyEvenDays && this.timeOnlyOddDays) {
this.timeOnlyEvenDays = false;
this.timeOnlyOddDays = false;
}

@@ -311,3 +315,3 @@

this.on('input', function (msg, send, done) { // eslint-disable-line complexity
this.on('input', function (msg, send, done) {
// If this is pre-1.0, 'done' will be undefined

@@ -314,0 +318,0 @@ done = done || function (text, msg) { if (text) { return node.error(text, msg); } return null; };

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

@@ -210,6 +210,2 @@ "keywords": [

"array-callback-return": "error",
"complexity": [
"warn",
35
],
"consistent-return": "error",

@@ -216,0 +212,0 @@ "no-lone-blocks": "error",

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 too big to display

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 not supported yet

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

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