Will These Work With Python 3?

Posted on
Mon Mar 11, 2024 3:07 pm
CraigM offline
Posts: 589
Joined: Oct 28, 2007

Will These Work With Python 3?

I would appreciate it if you could look over this code and see if they are good to go with Python 3, or changes need to be made.
Thanks

Code: Select all
if indigo.variables[1255222542].value == "true":
      indigo.actionGroup.execute(1722700584) # "KPL [mbath] LED Brightness DAY"
elif indigo.variables[1255222542].value == "false":
      indigo.actionGroup.execute(571210734) # "KPL [mbath] LED Brightness NIGHT"


Code: Select all
# Get the drip instance
sprinkler = indigo.devices[1334555428]
if sprinkler.states["activeZone"] > 0:
    #if the active zone is greater than 0 then it's running
    indigo.variable.updateValue(1612324636, value="Irrigation Zone Running")
else:
    # if the active zone is 0 then it's not running
    indigo.variable.updateValue(1612324636, value="")


Code: Select all
if (indigo.devices[122316047].onState == True):
      indigo.insteon.sendSceneOn(8)
else:
      indigo.insteon.sendSceneOff(8)


Code: Select all
# Set up Variables
Shades_CurrentState = indigo.variables[1879201124].value

# Run Appropriate Action Group
if Shades_CurrentState == "up":
      indigo.actionGroup.execute(1964223200) # "Shades [lvr] DOWN"
else:
   if Shades_CurrentState == "down":
      indigo.actionGroup.execute(1024457751) # "Shades [lvr] UP"


Code: Select all
import datetime
now = datetime.datetime.now()

DayofWeek = now.strftime('%A')
indigo.variable.updateValue(1116262770, DayofWeek)


Code: Select all
import datetime
now = datetime.datetime.now()

Month = now.strftime('%B')
indigo.variable.updateValue(1883706503, Month)


Code: Select all
if indigo.variables[1747089685].value == "off":
      indigo.actionGroup.execute(1577365829) # "TV ACTIVITY [watch]"
elif indigo.variables[1747089685].value == "on":
      indigo.actionGroup.execute(518087377) # "TV ACTIVITY [off]"

Posted on
Mon Mar 11, 2024 4:10 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Will These Work With Python 3?

I don't see anything there that would be a problem.

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

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests

cron