Test device states for conditional

Posted on
Tue Nov 19, 2019 9:44 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Test device states for conditional

I'm testing 3 devices (LED1..3) for On condition. The conditional is not executing.
Code: Select all
# Device to be tested
led1 = indigo.devices[1017239549] # dRm kPdW LED#1
led2 = indigo.devices[344309186] # dRm kPdW LED#2
led3 = indigo.devices[80685492] # dRm kPdW LED#3

#test device condition
if (led1.onState or led2.onState or led3.onState):
   indigo.device.turnOff(1690393401)

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

Re: Test device states for conditional

Looks good at first glance. Are you sure one of those is actually on? How are you executing your test? And is that the full script or just part of it?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 11 guests