From 256b19c07500468fd321b436b45513332bf90e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Senart?= <> Date: Sat, 4 Jan 2025 18:24:15 +0100 Subject: [PATCH] [#13] Using HassIO, connection to the supervisor requires Authorization header. --- CHANGELOG.md | 11 +++++++++++ gazpar2haws/haws.py | 2 +- pyproject.toml | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3fd6d5..c1e802d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,20 +1,30 @@ # Changelog + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.4] - 2025-01-04 + +### Fixed + +[#13](https://github.com/ssenart/gazpar2haws/issues/13): Using HassIO, connection to the supervisor requires Authorization header. + ## [0.1.3] - 2025-01-03 ### Changed + [#11](https://github.com/ssenart/gazpar2haws/issues/11): Upgrade PyGazpar version to 1.2.6. ## [0.1.2] - 2024-12-30 ### Added + [#2](https://github.com/ssenart/gazpar2haws/issues/2): DockerHub deployment. ### Fixed + [#9](https://github.com/ssenart/gazpar2haws/issues/9): Incorrect timezone info creates duplicate import. [#6](https://github.com/ssenart/gazpar2haws/issues/6): The last meter value may be imported multiple times and cause the today value being wrong. @@ -24,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.1.1] - 2024-12-22 ### Added + [#1](https://github.com/ssenart/gazpar2haws/issues/1): Publish energy indicator in kWh. ## [0.1.0] - 2024-12-21 diff --git a/gazpar2haws/haws.py b/gazpar2haws/haws.py index e55652e..d208082 100644 --- a/gazpar2haws/haws.py +++ b/gazpar2haws/haws.py @@ -23,7 +23,7 @@ async def connect(self): ws_url = f"ws://{self._host}:{self._port}/api/websocket" # Connect to the websocket - self._websocket = await websockets.connect(ws_url) + self._websocket = await websockets.connect(ws_url, additional_headers={"Authorization": f"Bearer {self._token}"}) # When a client connects to the server, the server sends out auth_required. connect_response = await self._websocket.recv() diff --git a/pyproject.toml b/pyproject.toml index bf07b81..c86c891 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "gazpar2haws" -version = "0.1.3" +version = "0.1.4" description = "Gazpar2HAWS is a gateway that reads data history from the GrDF (French gas provider) meter and send it to Home Assistant using WebSocket interface" authors = ["Stéphane Senart"] license = "MIT"