Save state then set saved state back to devices

Posted on
Thu Dec 12, 2019 7:05 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: Save state then set saved state back to devices

I am trying to spin a little around my script. As of now, I have the following:

Code: Select all
if Chandelier.onState == True:
    indigo.dimmer.setBrightness(Chandelier, value=5)
else:
   indigo.server.log("Chandelier - Attic is already OFF. No pre off possible'")


But this is not exactly what I want. Because if the level is at 1%, it will actually increase in the "pre off" period.
So, what would the syntax for a grater than expression be?

Code: Select all
if Chandelier.Brightness > 5:
    indigo.dimmer.setBrightness(Chandelier, value=5)
else:
   indigo.server.log("Chandelier - Attic is already OFF. No pre off possible'")


Something like the above, but with the right syntax. Anyone that can give me a hint? :)
And if this is documented in the indigo documentation, where would that be?

Håvard

Posted on
Thu Dec 12, 2019 8:40 am
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Save state then set saved state back to devices

https://wiki.indigodomo.com/doku.php?id ... digodimmer

You have it almost right. The Brightness property is .brightness, not .Brightness.

You also have an extra single quote (') in the log statement.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Dec 13, 2019 5:54 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: Save state then set saved state back to devices

Thanks!
That worked


Sent from my iPhone using Tapatalk

Håvard

Who is online

Users browsing this forum: No registered users and 3 guests