mfreeborn / heliocron

A command line application written in Rust capable of delaying execution of other programs for time periods relative to sunrise and sunset.
Apache License 2.0
241 stars 11 forks source link

Add time thresholds #30

Closed min2sia closed 2 years ago

min2sia commented 3 years ago

Hi, thanks for this handy tool!

My use case for heliocron is to control window blinds: open at sunrise and shut at sunset. That works fine for the most part of the year, except for the summer. For example, I would like to wake up at 07:00 in the morning, but if the sun rises at 06:00 or even earlier and the blinds open with sunrise, my morning is ruined... Also in the evening I would like my room to be dark when I go to bed, but sun may be setting much later than that. I thought, it would be convenient to have 2 more threshold options in heliocron:

  1. "No earlier than". It would prevent sunrise event from firing before specified time. As per example above, if I would like to set a threshold that blinds never open before 07:00. Only at 07:00 or later.
  2. "No later than". Similarly in the evening, the sunset event would be fired no later than specified time. E.g., my blinds would always shut at 22:00 if the sun sets after that time.
mfreeborn commented 2 years ago

It's definitely a nice idea that I'm not opposed to, I just don't have the resources to commit to it unfortunately! If someone wanted to pick it up in the future, I'd be open to it.