Convert to Python

Posted on
Sat Aug 22, 2020 2:27 pm
ckeyes888 offline
Posts: 2287
Joined: Nov 26, 2009
Location: Kalispell, MT

Convert to Python

Hey,

Appreciate any help converting this one to Python.
Code: Select all
tell application "IndigoServer"
   if value of variable "RecVolume" is greater than 40 then
      set theVolume to (value of variable "RecVolume") - 3
      dim device "Receiver Volume 1" to theVolume
   end if
end tell

Thanks,

Carl

Posted on
Sat Aug 22, 2020 9:00 pm
kw123 offline
User avatar
Posts: 7731
Joined: May 12, 2013
Location: Dallas, TX

Re: Convert to Python

Code: Select all
theVolume = int(indigo.variables["RecVolume"].value)
if theVolume > 40:
    indigo.dimmer.setBrightness("Receiver Volume 1", value=theVolume-3)

this should do it .. if "Receiver Volume 1", is a dimmer device

you can replace "device name" with devId = the id of the device and the same for the variable and remove the "" when you use the devId

Karl

Posted on
Sun Aug 23, 2020 9:35 pm
ckeyes888 offline
Posts: 2287
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Convert to Python

Excellent! Thanks!

Carl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest