Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/Xnoppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,14 @@ def playother(EmbySession,data,scripterx=False):
if EmbySession.config["DebugLevel"]>0: print("Fin Replay")

def playto_file(EmbySession,data,scripterx=False):
if EmbySession.config["TV"]==True:
logging.info ('Guardamos app TV actual')
try:
result = set_app_current(EmbySession.config)
if EmbySession.config["DebugLevel"]>0: print(result)
logging.info ('Resultado: %s',str(result))
except:
pass
EmbySession.playstate="Loading"
EmbySession.currentdata=data
if EmbySession.config["DebugLevel"]>0: print("scripterx is " + str(scripterx))
Expand Down
35 changes: 32 additions & 3 deletions web/libraries/TV/LG/Xnoppo_TV.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,12 @@ def tv_change_hdmi(config):
logging.info (store["client_key"])
source_control = SourceControl(client)
sources = source_control.list_sources()
app = ApplicationControl(client)
currentapp=app.get_current()
config["current_LG"]=currentapp

if config["current_LG"]=='':
app = ApplicationControl(client)
currentapp=app.get_current()
config["current_LG"]=currentapp

source_control.set_source(sources[config["Source"]])
index=0
logging.info ('Listado de las entradas disponibles:')
Expand All @@ -197,6 +200,32 @@ def tv_change_hdmi(config):
index=index+1
return("OK")

def set_app_current(config):
print(config["TV_KEY"])
if config["TV_KEY"]=='':
store = {}
else :
store = {'client_key': config["TV_KEY"] }
print(store)
client = WebOSClient(config["TV_IP"])
try:
client.connect()
except:
print("Error conexion")
return("Error conexion")
for status in client.register(store):
if status == WebOSClient.PROMPTED:
print("Por favor acepta la conexion en la TV")
logging.info ("Por favor acepta la conexion en la TV")
elif status == WebOSClient.REGISTERED:
print("Registro correcto!")
logging.info ("Registro correcto!")

app = ApplicationControl(client)
currentapp=app.get_current()
config["current_LG"]=currentapp
return(currentapp)

def tv_set_prev(config):
print(config["TV_KEY"])
if config["TV_KEY"]=='':
Expand Down