Giter VIP home page Giter VIP logo

Comments (9)

AndKe avatar AndKe commented on June 15, 2024

Same here.
This is exactly what I came to report.
While troubleshooting I've made a debug print log:

 # this is when the function was called
2021-04-10 01:00:00.015625, light schedule updated 
# this is the resulting data .. for the day before.
dawn:  2021-04-09 02:59:08.007731
dusk:  2021-04-09 20:37:25.089938

Using Astral 2.2

from astral.

yasirroni avatar yasirroni commented on June 15, 2024

It seems the solution can be achieved by edit this line of code

astral/src/astral/sun.py

Lines 363 to 370 in 96496f0

delta = -observer.longitude - degrees(hourangle)
timeDiff = 4.0 * delta
timeUTC = 720 + timeDiff - eq_of_time(t)
td = minutes_to_timedelta(timeUTC)
dt = datetime.datetime(date.year, date.month, date.day) + td
dt = pytz.utc.localize(dt) # pylint: disable=E1120
return dt

from astral.

AndKe avatar AndKe commented on June 15, 2024

@yasirroni thanks, but what is that ? - it's not committed, not a PR? - will it make into a release soon?

from astral.

yasirroni avatar yasirroni commented on June 15, 2024

That is the code that astral use that we need to edit and make a PR to solve local timezone bug changing day.

from astral.

yasirroni avatar yasirroni commented on June 15, 2024

See suntime package. Basically they reproduce the same bug and I already fix that on suntime. Haven't got time to fix here too. I just pin point the problem for those willing to solve it.

from astral.

AndKe avatar AndKe commented on June 15, 2024

@yasirroni unfortunatly, I can not use suntime due to SatAgro/suntime#18

from astral.

yasirroni avatar yasirroni commented on June 15, 2024

Have you try my fork on test-pypi? Go to test-pypi and search suntime-yasirroni

from astral.

AndKe avatar AndKe commented on June 15, 2024

@yasirroni thanks, but I try to stick to libraries from pip or so, to prevent wild searching and retracing what I did when something needs to run on another distro/hardware x years later.

from astral.

yasirroni avatar yasirroni commented on June 15, 2024

@yasirroni thanks, but I try to stick to libraries from pip or so, to prevent wild searching and retracing what I did when something needs to run on another distro/hardware x years later.

Then, you can fork it and publish it on pypi yourself. Easy, hahaa

from astral.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.