Syntax for python script

qcvictor
Posts: 80
Joined: Thu Apr 23, 2015 6:35 pm
Location: Quebec, Canada

Syntax for python script

Post by qcvictor »

Hi Guys
I'm looking for get good syntax for use in python script, I want replace the send mail by prowl like in this example

Code: Select all

dev = indigo.devices[IOLINCID] # "IO Linc"
if not dev.states["binaryInput1"]:
    indigo.server.sendEmailTo("ADDRESSHERE", subject="The garage door is OPEN!!")
from the wiki!
User avatar
jay (support)
Site Admin
Posts: 18339
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Syntax for python script

Post by jay (support) »

I'd recommend just creating an Action Group that does the notification, then calling the action group from your script:

Code: Select all

dev = indigo.devices[IOLINCID] # "IO Linc"
if not dev.states["binaryInput1"]:
    indigo.actionGroup.execute(12345) # ID of action group that sends notification
That way you can change it, add more notifications, etc. in the UI rather than editing the script.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
Post Reply

Return to “Prowl Notify”