[ANSWERED] Set Brightness AND Duration?

Posted on
Mon Apr 14, 2014 8:45 pm
SpencerJRoberts offline
User avatar
Posts: 256
Joined: Dec 09, 2012
Location: Mountain View, CA

[ANSWERED] Set Brightness AND Duration?

Sorry for what is likely a simple question.

I am making a more involved light randomizer for when we are away and it is dark out. I would like to, in Python, set the brightness of certain lights AND the duration for them to be on in one line. I know you can set the duration with a "turnOn" command, but with the "setBrightness" command it seems you cannot. I suppose I could do the following:
Code: Select all
indigo.dimmer.setBrightness(123, value=75)
indigo.device.turnOff(123, delay=300)


But as always I'm looking for less lines whenever possible and I'm also interested in other ways to do this that I might not be aware of. Thanks in advance for any comments!

Posted on
Mon Apr 14, 2014 9:07 pm
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: Set Brightness AND Duration?

Two lines of code is a minimum in this case, so my solution would be identical to what you have. You can, of course, make your own python function that does both in a single call if you would like.

Image

Posted on
Mon Apr 14, 2014 9:35 pm
SpencerJRoberts offline
User avatar
Posts: 256
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: Set Brightness AND Duration?

Cool, just wanted to check. Thanks Matt!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests