In the ST docs, they note (see:
Scheduling — SmartThings Developer Documentation):
You can remove scheduled executions using the
unschedule()
method. [ … ]Note
Due to the way that the scheduling service is currently implemented,unschedule()
is a fairly expensive operation, and may take many seconds to execute.
Does this still apply in Hubitat? I’m trying to port my last remaining lighting automation from Home Assistant/AppDaemon (Python) to Hubitat, and I can convert my logic more easily if I don’t need to feel bad about using unschedule()
every time (for example) motion is detected again. The alternative is to do what I’ve done on ST and just use runIn()
and write the handler so that it does the checking and uses runIn()
to check again later if not, rather than being able to cancel these scheduled executions and assuming that it’s actually OK to proceed when the handler is called.
On a related note, the ST docs also don’t make it clear if it’s just unschedule() with no arguments that’s expensive or if it’s any call to unschedule() (since it also allows passing the name of a specific handler to cancel all scheduled executions for that particular handler—and if that’s the case, I guess I really didn’t need to avoid this on ST in the first place). In any case, I’m assuming the implementation in Hubitat is different, so I’m wondering if anyone can speak to how it works.
Thanks!