How to get enabled or disabled state of a trigger in Python

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
Forum rules
This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
User avatar
bob
Posts: 500
Joined: Wed Jun 14, 2006 7:55 am

How to get enabled or disabled state of a trigger in Python

Post by bob »

I read over the IOM but cannot see how to get enabled or disabled state of a trigger in Python?

I want to do something based on the trigger state like so:

Code: Select all

if indigo.triggers.enabled("myTrigger") = true:

thanks!

bob
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: How to get enabled or disabled state of a trigger in Pyt

Post by jay (support) »

Just like all of the Indigo python objects, first you get the correct object then you check the class property, in this case it's the enabled property.

Code: Select all

# get the trigger
trigger = indigo.triggers[TRIGGERID]
# check the enabled property
if trigger.enabled:
    # do whatever here
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
Locked

Return to “Extending Indigo with Plugins and Python”