Skip to content
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

sunrise: Add sunrise module to pixlet. #124

Merged
merged 3 commits into from
Jan 16, 2022

Conversation

betterengineering
Copy link
Contributor

@betterengineering betterengineering commented Jan 16, 2022

Overview

A few folks are looking to use the sunrise/sunset times in their apps. It's a wonderful feature for displays, especially ones we bring into our homes. There hasn't been an easy way to do this in starlark though and this change makes it super simple. Simply import sunrise.star and you'll have access to sunrise/sunset times for a given location.

Changes

  • sunrise: Add sunrise module to pixlet.
    • This commit adds the go-sunrise module to pixlet so that apps can make use of sunrise/sunset times. This has been a popular use case and hopefully this module will make it easier for more folks to take advantage of this information.

Tests

In addition to the unit tests added, I also added a full working example and spot checked it to ensure it's working as expected.

This commit adds the go-sunrise module to pixlet so that apps can make
use of sunrise/sunset times. This has been a popular use case and
hopefully this module will make it easier for more folks to take
advantage of this information.
@rohansingh
Copy link
Member

Looks great. We should also explicitly document/test the behavior for places where the sun doesn't rise or set.

This commit adds the None return type for an empty time zone and added
it to the example.
@betterengineering
Copy link
Contributor Author

betterengineering commented Jan 16, 2022

Looks great. We should also explicitly document/test the behavior for places where the sun doesn't rise or set.

Good call! I updated the logic to return a None since comparing an empty time would be annoying in starlark 😅 . Also added the case checking to the example. I really do hope someone brings a Tidbyt to the South Pole Station 😄 . Though, I suppose they'd need a reliable internet connection 24/7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants