Anyone tried this plugin with a Roku TV?
I looked at PLEX and couldn't find anything for deep linking with Roku. Any experience with this? If no, I can probably tackle that by using the latest PLEX Manger plugin which can push content to a device.
I was probably reading the same PLEX comments about deep linking... its unfortunate, but I can probably work around it using your other plugin… Not sure, I haven't messed with it yet. Thanks for all your help.... if you find yourself in Houston or next time inm in Baton Rogue, I owe you a few beers.
#/////////////////////////////////////////////////////////////////////////////////////////
# Python imports
#/////////////////////////////////////////////////////////////////////////////////////////
import socket
import struct
#/////////////////////////////////////////////////////////////////////////////////////////
#/////////////////////////////////////////////////////////////////////////////////////////
# sendWakeOnLAN
# Module-level function that executes a WOL request to the given MAC address
#/////////////////////////////////////////////////////////////////////////////////////////
#/////////////////////////////////////////////////////////////////////////////////////////
def sendWakeOnLAN(macaddress):
# Check macaddress format and try to compensate.
if len(macaddress) == 12:
pass
elif len(macaddress) == 12 + 5:
sep = macaddress[2]
macaddress = macaddress.replace(sep, '')
else:
raise ValueError(u'Incorrect MAC address format')
# Pad the synchronization stream.
data = ''.join(['FFFFFFFFFFFF', macaddress * 20])
send_data = ''
# Split up the hex values and pack.
for i in range(0, len(data), 2):
send_data = ''.join([send_data, struct.pack('B', int(data[i: i + 2], 16))])
# Broadcast it to the LAN.
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock.sendto(send_data, ('<broadcast>', 7))
if __name__ == '__main__':
sendWakeOnLAN("[REPLACE WITH YOUR MAC ADDRESS]")
data = ''.join(['FFFFFFFFFFFF', macaddress * 20])
data = ''.join(['94:e9:79:1c:e9:46', macaddress * 20])
but nothing happened. Did I mess that up? I'm a total zero with Python.
#/////////////////////////////////////////////////////////////////////////////////////////
# Python imports
#/////////////////////////////////////////////////////////////////////////////////////////
import socket
import struct
#/////////////////////////////////////////////////////////////////////////////////////////
#/////////////////////////////////////////////////////////////////////////////////////////
# sendWakeOnLAN
# Module-level function that executes a WOL request to the given MAC address
#/////////////////////////////////////////////////////////////////////////////////////////
#/////////////////////////////////////////////////////////////////////////////////////////
def sendWakeOnLAN(macaddress):
# Check macaddress format and try to compensate.
if len(macaddress) == 12:
pass
elif len(macaddress) == 12 + 5:
sep = macaddress[2]
macaddress = macaddress.replace(sep, '')
else:
raise ValueError(u'Incorrect MAC address format')
# Pad the synchronization stream.
data = ''.join(['FFFFFFFFFFFF', macaddress * 20])
send_data = ''
# Split up the hex values and pack.
for i in range(0, len(data), 2):
send_data = ''.join([send_data, struct.pack('B', int(data[i: i + 2], 16))])
# Broadcast it to the LAN.
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock.sendto(send_data, ('<broadcast>', 7))
sendWakeOnLAN("94:e9:79:1c:e9:46")
now I'm looking to see if I can poll the TV somehow to determine if it is On or Off. Any ideas?
Users browsing this forum: No registered users and 1 guest