Open nigelm opened 5 years ago
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.
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.
I've used https://github.com/araddon/dateparse in other places and it seems to do a pretty good job.
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 towardsclimate-on-at
, or possiblyclimate-scheduled-at
which is long and hard to type (but then leads naturally to the additional commandsclimate-schedule-status
andclimate-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