Enabling/disabling a trigger in Python

Posted on
Wed May 01, 2019 10:16 am
jay (support) offline
Site Admin
User avatar
Posts: 18216
Joined: Mar 19, 2008
Location: Austin, Texas

Enabling/disabling a trigger in Python

A user asked how to convert the following AppleScript snippit to Python:

Code: Select all
 disable time date action "timer_wakeup”


In order to answer for the benefit of the entire community, I'm posting the reply here. To do this, you want to use the enable() method in the indigo.trigger namespace:

Code: Select all
indigo.trigger.enable(IDOFTRIGGER, value=False)


For completeness, passing True will enable the trigger.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed May 01, 2019 10:41 am
Herbo offline
User avatar
Posts: 10
Joined: Jan 02, 2007
Location: Annapolis, MD

Re: Enabling/disabling a trigger in Python

Thanks for the info Jay!

However that doesn't answer my question - your solution is for a trigger.

The original AppleScript was to disable [or enable] a time date action which is typically under the Schedules category. Your solution only addresses Triggers.

AppleScript: disable time date action "timer_wakeup”

-Herb

Posted on
Wed May 01, 2019 7:47 pm
matt (support) offline
Site Admin
User avatar
Posts: 21416
Joined: Jan 27, 2003
Location: Texas

Re: Enabling/disabling a trigger in Python

Hi Herb,

Replace trigger with schedule and it should work:

Code: Select all
indigo.schedule.enable(ID_OF_SCHEDULE, value=False)

Image

Posted on
Wed May 01, 2019 8:01 pm
Herbo offline
User avatar
Posts: 10
Joined: Jan 02, 2007
Location: Annapolis, MD

Re: Enabling/disabling a trigger in Python

Matt-

Excellent - works like a champ!

Thanks,

-Herb

Posted on
Thu May 02, 2019 8:24 am
jay (support) offline
Site Admin
User avatar
Posts: 18216
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Enabling/disabling a trigger in Python

Herbo wrote:
Excellent - works like a champ!


FYI, when you change a post you've made earlier, no notification of the change is detected either in the follow function or the RSS feed. So it's likely to go unnoticed. Once you make a post, if you need to add more questions/comments, please post a follow-up. That will trigger all the various notification methods and will likely result in a more timely response.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests