diff --git a/time/79-suncalc.js b/time/79-suncalc.js index 2c5e8b54..2b265391 100644 --- a/time/79-suncalc.js +++ b/time/79-suncalc.js @@ -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; }