Python Script

Posted on
Mon Dec 05, 2016 5:43 am
Woetjes offline
Posts: 117
Joined: Apr 04, 2016
Location: Belgium

Python Script

Hi Joe,

I want to build a python script that execute different actions based on the current activity name of the plugin.
How do I get the the current activity name of the plugin in a python syntax?

Thank you,
Wouter

Posted on
Mon Dec 05, 2016 7:10 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Python Script

Woetjes wrote:
Hi Joe,

I want to build a python script that execute different actions based on the current activity name of the plugin.
How do I get the the current activity name of the plugin in a python syntax?

Thank you,
Wouter


Right clicking on the currentActivityName state in the hub's state list (Indigo client) and selecting "Copy Python Reference" gives you something like:

Code: Select all
activity = indigo.devices[316076711].states["currentActivityName"] # State "currentActivityName" of "Theater Hub"

The device number will change for you, of course.

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

Posted on
Mon Dec 05, 2016 7:16 am
Woetjes offline
Posts: 117
Joined: Apr 04, 2016
Location: Belgium

Re: Python Script

Ooooh - I didn't know you could do this :) Many thanks - makes my life a lot easier!!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests