Giter Club home page Giter Club logo

Comments (5)

rohansingh avatar rohansingh commented on July 19, 2024 5

We use go-sunrise in the Tidbyt backend to power the "dim before sunset" feature. It has the huge advantage of not requiring any network calls.

Here's an example of the Go usage:

rise, set := sunrise.SunriseSunset(
    43.65, -79.38,          // Toronto, CA
    2000, time.January, 1,  // 2000-01-01
)

Perhaps we could add Starlark bindings for it and then we wouldn't need any special magic variable.

from community.

dinosaursrarr avatar dinosaursrarr commented on July 19, 2024 1

@joeyhoer -- I have tidbyt/pixlet#381 out at the moment which would let you do the maths. You could use sunrise.elevation_time to compute when the sun is at a certain angle below the horizon.

Or use the sunrise.elevation function to determine whether it's currently day, civil, nautical, astronomical, or night for a given location.

from community.

henryso avatar henryso commented on July 19, 2024

Perhaps we could add Starlark bindings for it and then we wouldn't need any special magic variable.

That sounds like a really good idea. Calling (and caching) api.sunrise-sunset.org for every potential latitude/longitude of Tidbyt users will probably lead to nightmares.

from community.

dinosaursrarr avatar dinosaursrarr commented on July 19, 2024

This was fixed by tidbyt/pixlet#124, right?

from community.

joeyhoer avatar joeyhoer commented on July 19, 2024

As a related request, I'm noticing that an abrupt change when "day" turns to "night" (and vice versa) in somewhat jarring. This could be resolved in the app by calculating some type of gradual transition; however, it could also be helpful to have variables for the different types of twilight (Civil twilight, Nautical twilight, and Astronomical twilight). This would provide app authors with the ability to slightly change colors to more accurately match ambient lighting without an physical light sensor connected to the Tidbyt (which would be a really cool hardware enhancement).

from community.

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.