mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Update suncalc for new moonIllumination code.
The Node Suncal library has changed the moon function name this changes the code to cope with it.
In this commit to suncalc.
bf5ee6377e
So now this causes node to crash.
This commit is contained in:
parent
ec3c36dfdd
commit
fdeb0ba71c
@ -38,7 +38,7 @@ function SunNode(n) {
|
||||
var mins2 = times[node.end].getUTCMinutes();
|
||||
var e1 = (hour*60+mins) - (hour1*60+mins1);
|
||||
var e2 = (hour*60+mins) - (hour2*60+mins2);
|
||||
var moon = parseInt(SunCalc.getMoonFraction(now)*100)/100;
|
||||
var moon = SunCalc.getMoonIllumination(now).fraction;
|
||||
msg = { payload:0, topic:"sun", moon:moon };
|
||||
if ((e1 > 0) & (e2 < 0)) { msg.payload = 1; }
|
||||
if (oldval == null) { oldval = msg.payload; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user