The return in device handlers is the commands, so they must be last in the method.
You made log.debug last in the method, so the result of the log.debug command is what is returned to execute rather than the commands in the delayBetween.
Thanks. I had kind of come to that conclusion after I made the post. Is that actually documented somewhere - I was about to look, and will look.
[This is also a Groovy pet peeve of mine. By using “def” they make code a lot less self-documenting. Had the method indicated it returned a list of commands, well, then it would have been pretty obvious.]
Mine, as well. I ALWAYS use return statements for documentation reasons and it helps keep me sane. And makes it obvious to another person reading the code for the first time…