Page 1 of 1

Code for enumerating schedules

PostPosted: Thu Oct 19, 2017 10:45 am
by trevorsmith
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

Re: Code for enumerating schedules

PostPosted: Thu Oct 19, 2017 5:55 pm
by jay (support)
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... ;)

Re: Code for enumerating schedules

PostPosted: Fri Oct 20, 2017 12:48 am
by trevorsmith
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

Re: Code for enumerating schedules

PostPosted: Fri Oct 20, 2017 8:30 am
by matt (support)
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.