astronomy: Changes to README.md

master
Peter Hinch 2023-12-08 18:15:37 +00:00
rodzic 2068a3946e
commit e55334f690
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -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():

Wyświetl plik

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