2013-11-01, 22:05
Hi Gang,
I have been struggling trying to improve the YAC Listener addon, but have not been able to contact the developer.
YAC Listener basically displays Caller ID on your XBMC machine when a phone call comes in. I have it working great on my home network.
But I want to add the ability to ALSO pause the playback on the XBMC machines when a call is received, so someone can go answer the phone.
The whole addon is this code:
You can see towards the bottom there is a line that reads:
Below that line, I added a line that reads:
BUT, I got a Python error when rebooting my XBMC. Then I tried replacing the Notification line with the Pause line; a phone call properly paused playback on XBMC.
So either line works independently, but when use together, it does not work.
Can someone please help me solve this... any advice or guidance is greatly appreciated.
Thanks,
Hernando
I have been struggling trying to improve the YAC Listener addon, but have not been able to contact the developer.
YAC Listener basically displays Caller ID on your XBMC machine when a phone call comes in. I have it working great on my home network.
But I want to add the ability to ALSO pause the playback on the XBMC machines when a call is received, so someone can go answer the phone.
The whole addon is this code:
Code:
import socket, threading, thread, sys, asyncore, xbmc, xbmcgui
from time import *
from string import *
PORT = 10629
class Server(asyncore.dispatcher):
def __init__(self, host, port):
asyncore.dispatcher.__init__(self)
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.bind((host, port))
self.listen(1)
def handle_accept(self):
socket, address = self.accept()
ConnectionHandler(socket)
def handle_close(self):
self.close()
class ConnectionHandler(asyncore.dispatcher_with_send):
def handle_read(self):
self.buffer = self.recv(1024)
self.buffer = split(self.buffer[5:], "~")
self.close()
global data
if len(self.buffer) > 1:
name = self.buffer[0]
number = self.buffer[1]
xbmc.executebuiltin("XBMC.Notification("+name+","+number+",7000,special://home/addons/script.yaclistener/phone.png)")
else:
data = self.buffer
s = Server('', PORT)
while not xbmc.abortRequested:
asyncore.loop(timeout=1)
s.close()
sys.exit()
You can see towards the bottom there is a line that reads:
Code:
xbmc.executebuiltin("XBMC.Notification("+name+","+number+",7000,special://home/addons/script.yaclistener/phone.png)")
Below that line, I added a line that reads:
Code:
xbmc.executebuiltin("XBMC.Action(Pause)")
BUT, I got a Python error when rebooting my XBMC. Then I tried replacing the Notification line with the Pause line; a phone call properly paused playback on XBMC.
So either line works independently, but when use together, it does not work.
Can someone please help me solve this... any advice or guidance is greatly appreciated.
Thanks,
Hernando