Page 1 of 1

Python Script

PostPosted: Mon Dec 05, 2016 5:43 am
by Woetjes
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

Re: Python Script

PostPosted: Mon Dec 05, 2016 7:10 am
by FlyingDiver
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.

Re: Python Script

PostPosted: Mon Dec 05, 2016 7:16 am
by Woetjes
Ooooh - I didn't know you could do this :) Many thanks - makes my life a lot easier!!