gazpar2haws 0.1.3__tar.gz → 0.1.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,36 @@
1
1
  # Changelog
2
+
2
3
  All notable changes to this project will be documented in this file.
3
4
 
4
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
7
 
8
+ ## [0.1.5] - 2025-01-04
9
+
10
+ ### Added
11
+
12
+ [#15](https://github.com/ssenart/gazpar2haws/issues/15): Using HassIO, websocket endpoint is /core/websocket.
13
+
14
+ ## [0.1.4] - 2025-01-04
15
+
16
+ ### Fixed
17
+
18
+ [#13](https://github.com/ssenart/gazpar2haws/issues/13): Using HassIO, connection to the supervisor requires Authorization header.
19
+
7
20
  ## [0.1.3] - 2025-01-03
8
21
 
9
22
  ### Changed
23
+
10
24
  [#11](https://github.com/ssenart/gazpar2haws/issues/11): Upgrade PyGazpar version to 1.2.6.
11
25
 
12
26
  ## [0.1.2] - 2024-12-30
13
27
 
14
28
  ### Added
29
+
15
30
  [#2](https://github.com/ssenart/gazpar2haws/issues/2): DockerHub deployment.
16
31
 
17
32
  ### Fixed
33
+
18
34
  [#9](https://github.com/ssenart/gazpar2haws/issues/9): Incorrect timezone info creates duplicate import.
19
35
 
20
36
  [#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 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
24
40
  ## [0.1.1] - 2024-12-22
25
41
 
26
42
  ### Added
43
+
27
44
  [#1](https://github.com/ssenart/gazpar2haws/issues/1): Publish energy indicator in kWh.
28
45
 
29
46
  ## [0.1.0] - 2024-12-21
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gazpar2haws
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: Gazpar2HAWS is a gateway that reads data history from the GrDF (French gas provider) meter and send it to Home Assistant using WebSocket interface
5
5
  License: MIT
6
6
  Author: Stéphane Senart
@@ -20,10 +20,11 @@ class Bridge:
20
20
  # Home Assistant configuration
21
21
  ha_host = config.get("homeassistant.host")
22
22
  ha_port = config.get("homeassistant.port")
23
+ ha_endpoint = config.get("homeassistant.endpoint")
23
24
  ha_token = config.get("homeassistant.token")
24
25
 
25
26
  # Initialize Home Assistant
26
- self._homeassistant = HomeAssistantWS(ha_host, ha_port, ha_token)
27
+ self._homeassistant = HomeAssistantWS(ha_host, ha_port, ha_endpoint, ha_token)
27
28
 
28
29
  # Initialize Gazpar
29
30
  self._gazpar = []
@@ -8,9 +8,10 @@ Logger = logging.getLogger(__name__)
8
8
 
9
9
  # ----------------------------------
10
10
  class HomeAssistantWS:
11
- def __init__(self, host, port, token):
11
+ def __init__(self, host: str, port: str, endpoint: str, token: str):
12
12
  self._host = host
13
13
  self._port = port
14
+ self._endpoint = endpoint
14
15
  self._token = token
15
16
  self._websocket = None
16
17
  self._message_id = 1
@@ -20,10 +21,10 @@ class HomeAssistantWS:
20
21
 
21
22
  Logger.debug(f"Connecting to Home Assistant at {self._host}:{self._port}")
22
23
 
23
- ws_url = f"ws://{self._host}:{self._port}/api/websocket"
24
+ ws_url = f"ws://{self._host}:{self._port}{self._endpoint}"
24
25
 
25
26
  # Connect to the websocket
26
- self._websocket = await websockets.connect(ws_url)
27
+ self._websocket = await websockets.connect(ws_url, additional_headers={"Authorization": f"Bearer {self._token}"})
27
28
 
28
29
  # When a client connects to the server, the server sends out auth_required.
29
30
  connect_response = await self._websocket.recv()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "gazpar2haws"
3
- version = "0.1.3"
3
+ version = "0.1.5"
4
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"
5
5
  authors = ["Stéphane Senart"]
6
6
  license = "MIT"
File without changes
File without changes