From d81c2465b8135482c2ced5f9efd0fd9594080499 Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 7 Mar 2021 10:28:16 +0000 Subject: [PATCH] final tweaks to make upgrading from v2 easier --- README.md | 12 +++++-- lib/sun-events-node.html | 62 +++++++++++++++++++++--------------- lib/sun-events-node.js | 4 +-- lib/sun-events.js | 2 +- spec/sun-events-node-spec.js | 17 ++++------ spec/sun-events-spec.js | 10 ++---- 6 files changed, 58 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 2b44c84..e4e4a5a 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,17 @@ and the resulting Sun events are output from this node at the appropriate time: * dawn: dawn (morning nautical twilight ends, morning civil twilight starts) * nadir: nadir (darkest moment of the night, sun is in the lowest position) -## Usage -Please Note: The latest version (version 3) of this node works a little differently to previous versions and will require a change to your flow if you are upgrading from a previous version. +## Upgrading from v2.x +The latest version (v3.0) of this node works a little differently to previous versions and will +require a change to your flow if you are upgrading from a previous version. + +The latitude and longitude you defined in the node's configuration can be used to calculate +Sun events if no latitude and longitude coordinates +are passed in the msg.payload. You must still inject a payload at regular +intervals to recalculate the next 24 hour's events, but this payload can be any value. + +## Usage Each time this node receives a new `msg.payload` to it's input, it calculates up to 2 days worth of Sun events (depending on what time of day it is invoked). To have the node output events reliably every day, you should inject a latitude and longitude payload into the node at least once every 24 hours. The easiest way to do this is with the node-red Inject node. diff --git a/lib/sun-events-node.html b/lib/sun-events-node.html index 5836810..e1d902e 100644 --- a/lib/sun-events-node.html +++ b/lib/sun-events-node.html @@ -19,7 +19,7 @@ --> -