Code Monkey home page Code Monkey logo

tizenws's People

Contributors

caphm avatar

Stargazers

 avatar

Watchers

 avatar  avatar

tizenws's Issues

Cannot get currenty running app

Hi,

I'm trying to get the currently running app from my TV, but it doesn't want to play ball. If I try to connect like this:

tizenws> connect 192.168.1.242

I get this error:

2022-10-02 22:54:42,111 - asyncio - ERROR - Exception in callback Cmd.reader()
handle: <Handle Cmd.reader()>
Traceback (most recent call last):
  File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.10/site-packages/asynccmd/asynccmd.py", line 117, in reader
    self._exec_cmd(line)
  File "/usr/lib/python3.10/site-packages/asynccmd/asynccmd.py", line 149, in _exec_cmd
    return func(arg)
  File "//./tizenws.py", line 417, in do_connect
    args[1] = "TizenWS Commandline"
IndexError: list assignment index out of range

It seems I'm short an argument... so I added in a random arg, and get this:

tizenws> connect 192.168.1.242 mytv
2022-10-02 22:57:45,718 - __main__ - DEBUG - Opening websocket connections
tizenws> 2022-10-02 22:57:45,718 - __main__ - ERROR - Failed to read storage file: [Errno 2] No such file or directory: 'mytv.token'
2022-10-02 22:57:45,718 - __main__ - DEBUG - remote: Attempting connection to wss://192.168.1.242:8002/api/v2/channels/samsung.remote.control?name=bXl0dg%3D%3D
2022-10-02 22:57:45,751 - __main__ - DEBUG - remote: Connection established
2022-10-02 22:57:45,772 - __main__ - DEBUG - remote: Authorization accepted
2022-10-02 22:57:45,772 - __main__ - DEBUG - Requesting list of installed apps
2022-10-02 22:57:45,773 - __main__ - DEBUG - control: Attempting connection to wss://192.168.1.242:8002/api/v2?name=bXl0dg%3D%3D
2022-10-02 22:57:45,815 - __main__ - DEBUG - Installed apps:
        YouTube Kids: 3201611111983
        YouTube: 111299991912
        (....plus a load mode I've cut off for size...)

I'm not sure why it's trying to read a token form the file system. I can't see any way of saving one from the help text.

Basically, my kids are always leaving the TV on. I've written a shell script which checks if the PlayStation is on, and checks if Kodi is playing a video. If neither is happening, it powers the TV off...

Problem is, if they're watching Netflix, YouTube Kids, etc. It keeps powering off the TV while they're watching it... I was hoping to call your code from a shell script and get it to return the currently running app. Only if no apps are running, will it power the TV off.

Thanks for any help you can give me with this one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.