From 48d707ec0c6818b5d7c896e59ea9b18a4a81cb2a Mon Sep 17 00:00:00 2001 From: Hartmut Bauer Date: Mon, 15 Jun 2026 23:35:06 +0200 Subject: [PATCH] remove modified pybravia --- README.md | 40 +++++++++++++++++++++++++++++++++++----- bravia8/__init__.py | 2 ++ bravia8/remote.py | 5 +++-- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0079f32..cc31b9f 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,44 @@ The BRAVIA 8A uses only HTTPS for communication, which makes the Home Assistant integration SonyBravia unusable. This project provides a workaround. -We get the directory ```pybravia``` from https://github.com/Drafteed/pybravia rename it to ```pybravia8``` and modify it to use HTTPS (changes in ```client.py```). The Module ```bravia8``` uses this. - The main script ```bravia8_pyscript.py``` utilizes the HACS custom integration ```pyscript``` (https://github.com/custom-components/pyscript). +## Changelog +``` +15.06.2026 - 2.0.0 - Update to latest pyscript version (2.0.1), removed modified pybravia module, + as latest versions (>0.4.0) can handle HTTPS. + 2025 - 1.0.0 - Initial release using modified pybravia module +``` + ## Installation -Install ```pyscript``` following the instructions on the [pyscript GitHub repository](https://github.com/custom-components/pyscript). +`````` ==> ```Volume=/var/containers/vol/hass/config:/config:z``` -Copy ```bravia8/``` and ```pybravia8/``` to ```/pyscript/modules/```. +Install ```pyscript``` following the instructions on the [pyscript GitHub repository](https://github.com/custom-components/pyscript): -Copy ```bravia8_pyscript.py``` to ```/pyscript/```. +- From the [latest release](https://github.com/custom-components/pyscript/releases) download the zip file hass-custom-pyscript.zip +- Move the zip file to ```/Server/transfer``` +- unpack there to ```./pyscript``` (no ```unzip``` on CoreOS) +- ```cd /var/containers/vol/hass/config/custom_components/pyscript``` +- ```rm -rf * ._*``` +- ```cp -R /srv/nas/Server/transfer/pyscript/* .``` + +Copy ```bravia8/``` ```/pyscript/modules/``` + +Copy ```bravia8_pyscript.py``` to ```/pyscript/``` + +```systemctl --user stop hass-pod && systemctl --user start hass-pod``` + +## Usage in Home Assistant + +In ```scripts.yaml``` + +``` +tv_command_hdmi1: + alias: Sony-TV send_command Hdmi1 + sequence: + - service: pyscript.bravia_send_command # -> def bravia_send_command(command) + data: + command: Hdmi1 + mode: single +``` diff --git a/bravia8/__init__.py b/bravia8/__init__.py index 74d0d61..c273677 100644 --- a/bravia8/__init__.py +++ b/bravia8/__init__.py @@ -1,2 +1,4 @@ from .remote import BraviaRemote + +__VERSION__ = "2.0.0" diff --git a/bravia8/remote.py b/bravia8/remote.py index f90c357..ce281ac 100644 --- a/bravia8/remote.py +++ b/bravia8/remote.py @@ -1,12 +1,13 @@ import logging +import ssl -from pybravia8 import BraviaClient, BraviaError +from pybravia import BraviaClient, BraviaError _LOGGER = logging.getLogger(__name__) class BraviaRemote: def __init__(self, host, psk): - self.client = BraviaClient(host) + self.client = BraviaClient(host=host, ssl=True, ssl_verify=False) self.psk = psk self.connected = False