gazpar2haws 0.1.11__tar.gz → 0.1.12__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.
- {gazpar2haws-0.1.11 → gazpar2haws-0.1.12}/CHANGELOG.md +14 -0
- {gazpar2haws-0.1.11 → gazpar2haws-0.1.12}/PKG-INFO +1 -1
- {gazpar2haws-0.1.11 → gazpar2haws-0.1.12}/gazpar2haws/bridge.py +23 -2
- {gazpar2haws-0.1.11 → gazpar2haws-0.1.12}/gazpar2haws/gazpar.py +54 -4
- {gazpar2haws-0.1.11 → gazpar2haws-0.1.12}/pyproject.toml +1 -1
- {gazpar2haws-0.1.11 → gazpar2haws-0.1.12}/LICENSE +0 -0
- {gazpar2haws-0.1.11 → gazpar2haws-0.1.12}/README.md +0 -0
- {gazpar2haws-0.1.11 → gazpar2haws-0.1.12}/gazpar2haws/__init__.py +0 -0
- {gazpar2haws-0.1.11 → gazpar2haws-0.1.12}/gazpar2haws/__main__.py +0 -0
- {gazpar2haws-0.1.11 → gazpar2haws-0.1.12}/gazpar2haws/config_utils.py +0 -0
- {gazpar2haws-0.1.11 → gazpar2haws-0.1.12}/gazpar2haws/haws.py +0 -0
- {gazpar2haws-0.1.11 → gazpar2haws-0.1.12}/gazpar2haws/version.py +0 -0
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [0.1.12] - 2025-01-15
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
|
12
|
+
[#37](https://github.com/ssenart/gazpar2haws/issues/37): Error GrDF send missing data with type="Absence de Données".
|
13
|
+
|
14
|
+
[#38](https://github.com/ssenart/gazpar2haws/issues/38): Using the HA addon, the PCE identifier is transformed into another number.
|
15
|
+
|
16
|
+
[#36](https://github.com/ssenart/gazpar2haws/issues/36): Error if HA endpoint configuration is missing in configuration.yaml.
|
17
|
+
|
18
|
+
### Added
|
19
|
+
|
20
|
+
[#33](https://github.com/ssenart/gazpar2haws/issues/33): Dockerhub 'latest' tag is currently published only if the release is created in the main branch.
|
21
|
+
|
8
22
|
## [0.1.11] - 2025-01-12
|
9
23
|
|
10
24
|
### Fixed
|
@@ -16,12 +16,30 @@ class Bridge:
|
|
16
16
|
def __init__(self, config: config_utils.ConfigLoader):
|
17
17
|
|
18
18
|
# GrDF scan interval (in seconds)
|
19
|
+
if config.get("grdf.scan_interval") is None:
|
20
|
+
raise ValueError("Configuration parameter 'grdf.scan_interval' is missing")
|
19
21
|
self._grdf_scan_interval = int(config.get("grdf.scan_interval"))
|
20
22
|
|
21
|
-
# Home Assistant configuration
|
23
|
+
# Home Assistant configuration: host
|
24
|
+
if config.get("homeassistant.host") is None:
|
25
|
+
raise ValueError("Configuration parameter 'homeassistant.host' is missing")
|
22
26
|
ha_host = config.get("homeassistant.host")
|
27
|
+
|
28
|
+
# Home Assistant configuration: port
|
29
|
+
if config.get("homeassistant.port") is None:
|
30
|
+
raise ValueError("Configuration parameter 'homeassistant.port' is missing")
|
23
31
|
ha_port = config.get("homeassistant.port")
|
24
|
-
|
32
|
+
|
33
|
+
# Home Assistant configuration: endpoint
|
34
|
+
ha_endpoint = (
|
35
|
+
config.get("homeassistant.endpoint")
|
36
|
+
if config.get("homeassistant.endpoint")
|
37
|
+
else "/api/websocket"
|
38
|
+
)
|
39
|
+
|
40
|
+
# Home Assistant configuration: token
|
41
|
+
if config.get("homeassistant.token") is None:
|
42
|
+
raise ValueError("Configuration parameter 'homeassistant.token' is missing")
|
25
43
|
ha_token = config.get("homeassistant.token")
|
26
44
|
|
27
45
|
# Initialize Home Assistant
|
@@ -29,6 +47,9 @@ class Bridge:
|
|
29
47
|
|
30
48
|
# Initialize Gazpar
|
31
49
|
self._gazpar = []
|
50
|
+
|
51
|
+
if config.get("grdf.devices") is None:
|
52
|
+
raise ValueError("Configuration parameter 'grdf.devices' is missing")
|
32
53
|
for grdf_device_config in config.get("grdf.devices"):
|
33
54
|
self._gazpar.append(Gazpar(grdf_device_config, self._homeassistant))
|
34
55
|
|
@@ -19,15 +19,59 @@ class Gazpar:
|
|
19
19
|
|
20
20
|
self._homeassistant = homeassistant
|
21
21
|
|
22
|
-
# GrDF configuration
|
22
|
+
# GrDF configuration: name
|
23
|
+
if config.get("name") is None:
|
24
|
+
raise ValueError("Configuration parameter 'grdf.devices[].name' is missing")
|
23
25
|
self._name = config.get("name")
|
24
|
-
|
26
|
+
|
27
|
+
# GrDF configuration: data source
|
28
|
+
self._data_source = (
|
29
|
+
config.get("data_source") if config.get("data_source") else "json"
|
30
|
+
)
|
31
|
+
|
32
|
+
# GrDF configuration: username
|
33
|
+
if self._data_source != "test" and config.get("username") is None:
|
34
|
+
raise ValueError(
|
35
|
+
"Configuration parameter 'grdf.devices[].username' is missing"
|
36
|
+
)
|
25
37
|
self._username = config.get("username")
|
38
|
+
|
39
|
+
# GrDF configuration: password
|
40
|
+
if self._data_source != "test" and config.get("password") is None:
|
41
|
+
raise ValueError(
|
42
|
+
"Configuration parameter 'grdf.devices[].password' is missing"
|
43
|
+
)
|
26
44
|
self._password = config.get("password")
|
45
|
+
|
46
|
+
# GrDF configuration: pce_identifier
|
47
|
+
if self._data_source != "test" and config.get("pce_identifier") is None:
|
48
|
+
raise ValueError(
|
49
|
+
"Configuration parameter 'grdf.devices[].pce_identifier' is missing"
|
50
|
+
)
|
27
51
|
self._pce_identifier = str(config.get("pce_identifier"))
|
28
|
-
|
52
|
+
|
53
|
+
# GrDF configuration: tmp_dir
|
54
|
+
self._tmp_dir = config.get("tmp_dir") if config.get("tmp_dir") else "/tmp"
|
55
|
+
|
56
|
+
# GrDF configuration: last_days
|
57
|
+
if config.get("last_days") is None:
|
58
|
+
raise ValueError(
|
59
|
+
"Configuration parameter 'grdf.devices[].last_days' is missing"
|
60
|
+
)
|
29
61
|
self._last_days = int(str(config.get("last_days")))
|
62
|
+
|
63
|
+
# GrDF configuration: timezone
|
64
|
+
if config.get("timezone") is None:
|
65
|
+
raise ValueError(
|
66
|
+
"Configuration parameter 'grdf.devices[].timezone' is missing"
|
67
|
+
)
|
30
68
|
self._timezone = str(config.get("timezone"))
|
69
|
+
|
70
|
+
# GrDF configuration: reset
|
71
|
+
if config.get("reset") is None:
|
72
|
+
raise ValueError(
|
73
|
+
"Configuration parameter 'grdf.devices[].reset' is missing"
|
74
|
+
)
|
31
75
|
self._reset = bool(config.get("reset"))
|
32
76
|
|
33
77
|
# As of date: YYYY-MM-DD
|
@@ -129,7 +173,13 @@ class Gazpar:
|
|
129
173
|
continue
|
130
174
|
|
131
175
|
# Compute the total volume and energy
|
132
|
-
|
176
|
+
if reading[property_name] is not None:
|
177
|
+
total += reading[property_name]
|
178
|
+
else:
|
179
|
+
Logger.warning(
|
180
|
+
f"Missing property {property_name} for date {date}. Skipping..."
|
181
|
+
)
|
182
|
+
continue
|
133
183
|
|
134
184
|
statistics.append({"start": date.isoformat(), "state": total, "sum": total})
|
135
185
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "gazpar2haws"
|
3
|
-
version = "0.1.
|
3
|
+
version = "0.1.12"
|
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
|
license = { file = "LICENSE" }
|
6
6
|
readme = "README.md"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|