Code for enumerating schedules

Posted on
Thu Oct 19, 2017 10:45 am
trevorsmith offline
Posts: 78
Joined: Oct 08, 2016

Code for enumerating schedules

Does anyone have a code snippet of looping around all schedules in a script to get their properties eg time of day, name etc

I can't seem to find docs on the Schedule object.

In particular I'd like to extract the execution time of each and compare it to the current time to see which one should have run most recently......I need this so when Indigo starts up I can work out which of my heating schedules to run (for some reason my Mac rebooted overnight and my heating schedule was then out of whack)

Thanks

Posted on
Thu Oct 19, 2017 5:55 pm
jay (support) offline
Site Admin
User avatar
Posts: 15856
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Code for enumerating schedules

Schedules aren't fully implemented in Python yet so you'd need an AppleScript to do it. I don't have any code laying around that does that.

You might, however, want to just rethink how you schedule things so that you can have a startup trigger that fires and just does the right thing. I don't know how you have your thermostat schedules working so I don't know exactly what would be involved.

Of course, the real answer is to solve the problem (an unexpected reboot) rather than try to fix the symptoms... ;)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Oct 20, 2017 12:48 am
trevorsmith offline
Posts: 78
Joined: Oct 08, 2016

Re: Code for enumerating schedules

OK thanks.

I notice that a Schedule object has at least one property, namely the nextExecutionTime....there must be others????

Is the implementation of the Schedules object model destined to be available any time?

Thanks for replying

Posted on
Fri Oct 20, 2017 8:30 am
matt (support) offline
Site Admin
User avatar
Posts: 19436
Joined: Jan 27, 2003
Location: Texas

Re: Code for enumerating schedules

As you saw, there isn't much in the Schedule object right now. Finishing out the Indigo object model is definitely a higher priority now, but we don't have an ETA.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests