AutoRemote EG Plugin - Send variable info from EG to Phone
Posted: Wed Jun 25, 2014 10:45 pm
I have searched and searched but cannot find any info on what I am trying to do. Basically I want to get the song, artist, album info and album year from whatever is playing in Media Monkey and have it sent to my phone via AutoRemote as a message or notification. I have everything in place and just need to figure out how to get the info to send to my phone.
Here is what I have first. It's a Win 7 Ultimate SP1 box, Eventghost v0.4.1.r1669, AutoRemote Plugin v1.90.
1. I have a Tasker command to send "WhoIsThis" to EG and that is recognized fine and shows up in the log and goes to step two in my Song Info macro.
2. Is a MediaMonkey 'Get detailed song info'
3. A small bit of code to parse out just what I want. I tried it simple and as a function and it seems to wrk fine as it shows up in the log perfectly.
4. Now is where I get baffled. I setup an Action to send an AutoRemote Message or Notification and this is where it bombs. When I try to just send the variable is sends the literal then I read about putting the variable in curly braces. Still bombs. Then I kind of gleaned about prefacing the curly braces with 'X=:=' and it still bombs. I get the below error when I run it as it is above.
Maybe I am way off base here but it all seems to work right up until I try to send it to the phone. If someone could lend a hand or point out where I can read some more robust documentation on EventGhost or the AutoRemote plugin I would GREATLY appreciate it!!
Dave
Here is what I have first. It's a Win 7 Ultimate SP1 box, Eventghost v0.4.1.r1669, AutoRemote Plugin v1.90.
1. I have a Tasker command to send "WhoIsThis" to EG and that is recognized fine and shows up in the log and goes to step two in my Song Info macro.
2. Is a MediaMonkey 'Get detailed song info'
3. A small bit of code to parse out just what I want. I tried it simple and as a function and it seems to wrk fine as it shows up in the log perfectly.
Code: Select all
str = eg.event.payload
#print str
#def songInfo():
# global sinfo
# sinfo = "Song -", str[0], "Artist -", str[1], "Album -", str[2], "Album Year -", str[5]
# print sinfo
#print info
sinfo = "Song -", str[0]+'\n', "Artist -", str[1]+'\n', "Album -", str[2]+'\n', "Album Year -", str[5]
print sinfoCode: Select all
SongInfoStr
('Song -', u'Song Of The Wind\n', 'Artist -', u'Santana\n', 'Album -', u'Gold Greatest Hits\n', 'Album Year -', 2003)
AutoRemote: Sending =:={sinfo} to Tek420
Error in Action: "AutoRemote: Sending =:={sinfo} to Tek420"
Traceback (most recent call last) (1669):
File "C:\Program Files\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
return self(*args)
File "C:\Program Files\EventGhost\plugins\AutoRemote\__init__.py", line 937, in __call__
message = Message(self, key,text,ttl,password,target,files)
File "C:\Program Files\EventGhost\plugins\AutoRemote\__init__.py", line 849, in __init__
self.message = replacePythonCodeAndEncode(text)
File "C:\Program Files\EventGhost\plugins\AutoRemote\__init__.py", line 647, in replacePythonCodeAndEncode
print "Error: {" + item + '} does not evaluate to a String. Not replacing: ' + repr(e)
NameError: global name 'item' is not definedDave