-
Notifications
You must be signed in to change notification settings - Fork 1k
New module suntime
for sunrise and sunset time
#450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
This looks like a useful addition, however SatAgro/suntime is LGPL which is incompatible with micropython-lib's MIT license... |
I started from scratch with the formula provided by Wikipedia's Sunrise equation and it works. I'll provide a new clean and neat code under MIT license in the following days. |
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
I just pushed a commit with the new module implementation. I rebased it on |
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
Just rebased on top of |
By matching the order of class methods used in Python's datetime, code changes are easier to implement. Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
`timedelta` resolution is now 1 nanosecond, instead of 1 second. The module is now suitable for logging at microsecond scale and below. As a bonus, `timedelta` can now handle deltas which span ±292 years (instead of the previous ±68 years). The cost is 4 more bytes per instance. Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
When adding a negative integral number of days, time's reminder was lost and the result was one day less than expected. Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
Approximated calculation of sunrise and sunset time. Adapted from https://github.com/SatAgro/suntime.