Testing just one device with
- Code: Select all
if not (dev2.brightness > 10 ):
- Code: Select all
# if not (dev1.onState and \
# not dev2.brightness > 10 ):
- Code: Select all
# Device to be tested
dev1 = indigo.devices[35744300] # 1 k telLamp
dev2 = indigo.devices[1543856096] # 1 k whaleLamp
#test device condition
import time
time.sleep(1) #test device condition
if not (dev2.brightness > 10 ):
# if not (dev1.onState and \
# not dev2.brightness > 10 ):
# if both lamps are not on, turn them both on
indigo.actionGroup.execute(885970154) # k Lamps AG ON
else: # if both devices are on, turn them off
indigo.actionGroup.execute(4135325) # k Lamps AG OFF