Getting Songs plugin to execute actions from within Python
Posted: Sun Apr 23, 2017 1:14 pm
I have a plugin that run my Grand Concerto and I am trying to get the python code to communicate with the Sonos plugin. I can look at values within Sonos, but I am having trouble getting Sonos to perform actions. I tried two ways - the first fails, the second works but relies on an Action Group I wrote to perform:
42384538 is the ID of the Sonos device. 1445798824 is the ID of a Sonos Action Group that does Toggle Play. The action group works fine from the Indigo main interface, just not from within the Python script.
Error generated by first approach:
Any thoughts?
- Code: Select all
sqzPlugin = indigo.server.getPlugin("com.ssi.indigoplugin.Sonos")
sqzPlugin.executeAction("TogglePlay", deviceId="42384538")
- Code: Select all
indigo.actionGroup.execute(1445798824)
42384538 is the ID of the Sonos device. 1445798824 is the ID of a Sonos Action Group that does Toggle Play. The action group works fine from the Indigo main interface, just not from within the Python script.
Error generated by first approach:
- NuVo Grand Concerto Error Error in plugin execution runConcurrentThread:
Traceback (most recent call last):
File "plugin.py", line 226, in runConcurrentThread
File "plugin.py", line 266, in parseToServerLine
File "plugin.py", line 363, in parseToServer
ArgumentError: Python argument types in
PluginInfo.executeAction(PluginInfo, str)
did not match C++ signature:
executeAction(CPlugin {lvalue}, CCString actionTypeId, unsigned long deviceId=0, boost::python::api::object props=None, bool waitUntilDone=True)
NuVo Grand Concerto Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Any thoughts?