diff --git a/astronomy/README.md b/astronomy/README.md index 8895bf8..0e93b7f 100644 --- a/astronomy/README.md +++ b/astronomy/README.md @@ -309,7 +309,7 @@ from sched.sun_moon import RiSet async def turn_off_lights(rs): # Runs every day at 00:01:00 rs.set_day() # Re-calculate for new daylight - asyncio.sleep(rs.sunrise() - 60) + await asyncio.sleep(rs.sunrise() - 60) # Actually turn them off async def main(): @@ -328,7 +328,7 @@ from sched.sched import schedule, Sequence from sched.sun_moon import RiSet async def turn_off_lights(t): - asyncio.sleep(t) + await asyncio.sleep(t) # Actually turn them off async def main(): diff --git a/astronomy/sun_moon.py b/astronomy/sun_moon.py index c340ea3..0d4aa2b 100644 --- a/astronomy/sun_moon.py +++ b/astronomy/sun_moon.py @@ -254,7 +254,7 @@ class RiSet: st = self.sunset(1) if sun else self.moonset(1) if rt is None: if st is None: - t = (now % 86400) / 3600 # Time as UTC hours (float) + t = (now % 86400) / 3600 # Time as UTC hour of day (float) return self.sin_alt(t, sun) > 0 return st > now if st is None: