Page 1 of 1

Convert to Python

PostPosted: Sat Aug 22, 2020 2:27 pm
by ckeyes888
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

Re: Convert to Python

PostPosted: Sat Aug 22, 2020 9:00 pm
by kw123
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

Re: Convert to Python

PostPosted: Sun Aug 23, 2020 9:35 pm
by ckeyes888
Excellent! Thanks!

Carl