Code Monkey home page Code Monkey logo

pybravia's People

Contributors

696grocuttt avatar bieniu avatar drafteed avatar nickborgers avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

pybravia's Issues

Does this work with Sony UBP-X700?

Does this library work with the Sony UBP-X700? It should as far as I'm aware, but I've just done a quick test to try it out and hit the following error:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/opt/homebrew/Cellar/[email protected]/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 1064, in create
_connection
    raise exceptions[0]
  File "/opt/homebrew/Cellar/[email protected]/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 1049, in create
_connection
    sock = await self._connect_sock(
  File "/opt/homebrew/Cellar/[email protected]/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 960, in _connec
t_sock
    await self.sock_connect(sock, address)
  File "/opt/homebrew/Cellar/[email protected]/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/selector_events.py", line 500, in soc
k_connect
    return await fut
  File "/opt/homebrew/Cellar/[email protected]/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/selector_events.py", line 535, in _so
ck_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 61] Connect call failed ('192.168.1.38', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/matthewsimpson/Projects/Drafteed/pybravia/pybravia/client.py", line 154, in send_req
    response = await self._session.post(
  File "/opt/homebrew/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/opt/homebrew/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/opt/homebrew/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/opt/homebrew/lib/python3.10/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "/opt/homebrew/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/opt/homebrew/lib/python3.10/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.1.38:80 ssl:default [Connect call failed ('192.168.1.38', 80)]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/matthewsimpson/Projects/Drafteed/pybravia/playground.py", line 7, in test
    await client.pair("CLIENTID", "NICKNAME")
  File "/Users/matthewsimpson/Projects/Drafteed/pybravia/pybravia/client.py", line 105, in pair
    await self.register(PAIR_PIN, clientid, nickname)
  File "/Users/matthewsimpson/Projects/Drafteed/pybravia/pybravia/client.py", line 95, in register
    await self.send_rest_req(
  File "/Users/matthewsimpson/Projects/Drafteed/pybravia/pybravia/client.py", line 235, in send_rest_req
    return await self.send_req(
  File "/Users/matthewsimpson/Projects/Drafteed/pybravia/pybravia/client.py", line 173, in send_req
    raise BraviaTVConnectionError from err
pybravia.exceptions.BraviaTVConnectionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/matthewsimpson/Projects/Drafteed/pybravia/playground.py", line 11, in <module>
    asyncio.run(test())
  File "/opt/homebrew/Cellar/[email protected]/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/opt/homebrew/Cellar/[email protected]/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 646, in run_unt
il_complete
    return future.result()
  File "/Users/matthewsimpson/Projects/Drafteed/pybravia/playground.py", line 8, in test
    except BraviaTVError:
NameError: name 'BraviaTVError' is not defined

shell returned 1

I've tried to connect in the past and managed to connect and control it, but I've never been able to package it up and make use of it (aka add it to Home Assistant). My reason for bringing this up is that it should be possible to expand the scope of this library beyond just Bravia TVs and include other devices which can be controlled via IRCC.

EDIT: Also worth noting, the repo I linked to above contains some code related to discovering Sony devices on your network. I'm not sure how Home Assistant is set up for UPNP discovery, but there should at least be some information in there that could be applied to Home Assistant to enable autodiscovery for Sony IRCC devices.

First release discussion

This issue is open for possible discussion of the first release.

Todo list:

  • Initial release
  • CI and pre-commit
  • Basic logging
  • Typing (#4)
  • Tests
  • Improve docs

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.