python-qube-heatpump 1.3.1__tar.gz → 1.4.0__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.
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/PKG-INFO +1 -1
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/pyproject.toml +1 -1
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/client.py +45 -4
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/.github/workflows/ci.yml +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/.github/workflows/python-publish.yml +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/.gitignore +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/AGENTS.md +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/CLAUDE.md +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/LICENSE +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/README.md +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/pytest.ini +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/__init__.py +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/const.py +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/entities/__init__.py +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/entities/base.py +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/entities/binary_sensors.py +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/entities/sensors.py +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/entities/switches.py +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/models.py +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/py.typed +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/tests/conftest.py +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/tests/test_client.py +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/tests/test_const.py +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/tests/test_entities.py +0 -0
- {python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/tests/test_models.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-qube-heatpump
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: Async Modbus client for Qube Heat Pumps
|
|
5
5
|
Project-URL: Homepage, https://github.com/MattieGit/python-qube-heatpump
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/MattieGit/python-qube-heatpump/issues
|
{python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/client.py
RENAMED
|
@@ -33,17 +33,21 @@ class QubeClient:
|
|
|
33
33
|
self._connected = await self._client.connect()
|
|
34
34
|
return self._connected
|
|
35
35
|
|
|
36
|
+
@property
|
|
37
|
+
def is_connected(self) -> bool:
|
|
38
|
+
"""Return True if connected."""
|
|
39
|
+
return self._connected
|
|
40
|
+
|
|
36
41
|
async def close(self) -> None:
|
|
37
42
|
"""Close connection."""
|
|
38
43
|
self._client.close()
|
|
39
44
|
self._connected = False
|
|
40
45
|
|
|
41
46
|
async def get_all_data(self) -> QubeState:
|
|
42
|
-
"""Fetch all definition data and return a state object.
|
|
43
|
-
# Note: In a real implementation you might want to optimize this
|
|
44
|
-
# by reading contiguous blocks instead of one-by-one.
|
|
45
|
-
# For now, we wrap the individual reads for abstraction.
|
|
47
|
+
"""Fetch all definition data and return a state object.
|
|
46
48
|
|
|
49
|
+
This fetches core sensors for the official HA integration.
|
|
50
|
+
"""
|
|
47
51
|
state = QubeState()
|
|
48
52
|
|
|
49
53
|
# Helper to read and assign
|
|
@@ -80,6 +84,43 @@ class QubeClient:
|
|
|
80
84
|
|
|
81
85
|
return state
|
|
82
86
|
|
|
87
|
+
async def get_all_entities(self) -> dict[str, Any]:
|
|
88
|
+
"""Fetch all entity values from library definitions.
|
|
89
|
+
|
|
90
|
+
This reads all sensors, binary sensors, and switches defined in the
|
|
91
|
+
library's entity definitions. Used by the HACS integration.
|
|
92
|
+
|
|
93
|
+
Returns:
|
|
94
|
+
Dictionary mapping entity keys to their values.
|
|
95
|
+
"""
|
|
96
|
+
results: dict[str, Any] = {}
|
|
97
|
+
|
|
98
|
+
# Read all sensors
|
|
99
|
+
for key, entity in SENSORS.items():
|
|
100
|
+
try:
|
|
101
|
+
results[key] = await self.read_entity(entity)
|
|
102
|
+
except Exception as exc:
|
|
103
|
+
_LOGGER.debug("Error reading sensor %s: %s", key, exc)
|
|
104
|
+
results[key] = None
|
|
105
|
+
|
|
106
|
+
# Read all binary sensors
|
|
107
|
+
for key, entity in BINARY_SENSORS.items():
|
|
108
|
+
try:
|
|
109
|
+
results[key] = await self.read_entity(entity)
|
|
110
|
+
except Exception as exc:
|
|
111
|
+
_LOGGER.debug("Error reading binary sensor %s: %s", key, exc)
|
|
112
|
+
results[key] = None
|
|
113
|
+
|
|
114
|
+
# Read all switches
|
|
115
|
+
for key, entity in SWITCHES.items():
|
|
116
|
+
try:
|
|
117
|
+
results[key] = await self.read_entity(entity)
|
|
118
|
+
except Exception as exc:
|
|
119
|
+
_LOGGER.debug("Error reading switch %s: %s", key, exc)
|
|
120
|
+
results[key] = None
|
|
121
|
+
|
|
122
|
+
return results
|
|
123
|
+
|
|
83
124
|
async def read_value(self, definition: tuple) -> float | None:
|
|
84
125
|
"""Read a single value based on the constant definition."""
|
|
85
126
|
address, reg_type, data_type, scale, offset = definition
|
{python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/.github/ISSUE_TEMPLATE/bug_report.yml
RENAMED
|
File without changes
|
|
File without changes
|
{python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/.github/ISSUE_TEMPLATE/feature_request.yml
RENAMED
|
File without changes
|
|
File without changes
|
{python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/.github/workflows/python-publish.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/entities/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_qube_heatpump-1.3.1 → python_qube_heatpump-1.4.0}/src/python_qube_heatpump/models.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|