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

Timed climate control #27

Open
nigelm opened this issue Nov 12, 2019 · 3 comments
Open

Timed climate control #27

nigelm opened this issue Nov 12, 2019 · 3 comments

Comments

@nigelm
Copy link

nigelm commented Nov 12, 2019

I'd like to implement the scheduled start of climate control (you can tell its getting colder here!).

The additional API calls required can be plagerised from https://gitlab.com/tobiaswkjeldsen/dartcarwings

So then the commands need to be created. The climate-on command could be reused - if it has a timespec added then it i scheduled rather than immediate. However I am tending more towards climate-on-at, or possibly climate-scheduled-at which is long and hard to type (but then leads naturally to the additional commands climate-schedule-status and climate-schedule-cancel

Ideally I'd like the timespec to be handled in a similar fashion to the unix at command (see Specifying Time in https://www.computerhope.com/unix/uat.htm ), but that really needs a usable go module that does mostly the right thing - any suggestions?

Any comments before I go ahead?

-- Nigel

@joeshaw
Copy link
Owner

joeshaw commented Nov 18, 2019

I am happy with climate-on-at (and I guess climate-on-status an climate-on-cancel) if you are.

One question I have is whether people want to turn their climate on at a specific time, or at some time in the future? For the latter we could use Go's built-in time.Duration type, so you could say, climate-on-at 30m to turn it on in 30 minutes. Maybe both should be supported.

I'm not aware of any good fuzzy matching time libraries for Go. I will look around for one, but I think a good first stab at the problem would be to define a bunch of formats in the time.Parse mold and just run through them one at a time. Pretty gross, but it could cover a lot of the use cases.

@joeshaw
Copy link
Owner

joeshaw commented Nov 18, 2019

A couple potential options:

https://github.com/olebedev/when
https://github.com/bcampbell/fuzzytime
https://github.com/kierdavis/dateparser
https://github.com/araddon/dateparse

I haven't looked at transitive dependencies, but I'd like to keep them as minimal as possible.

@karora
Copy link
Contributor

karora commented Dec 2, 2019

I've used https://github.com/araddon/dateparse in other places and it seems to do a pretty good job.

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

No branches or pull requests

3 participants