python-qube-heatpump 1.4.7__tar.gz → 1.4.9__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.
Files changed (31) hide show
  1. python_qube_heatpump-1.4.9/PKG-INFO +81 -0
  2. python_qube_heatpump-1.4.9/README.md +62 -0
  3. python_qube_heatpump-1.4.9/docs/202506_modbus-lijst-qube.pdf +0 -0
  4. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/pyproject.toml +1 -1
  5. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/src/python_qube_heatpump/client.py +7 -1
  6. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/src/python_qube_heatpump/entities/base.py +4 -0
  7. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/src/python_qube_heatpump/entities/sensors.py +1 -0
  8. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/tests/test_client.py +7 -7
  9. python_qube_heatpump-1.4.7/PKG-INFO +0 -27
  10. python_qube_heatpump-1.4.7/README.md +0 -8
  11. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  12. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  13. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  14. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/.github/workflows/ci.yml +0 -0
  15. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/.github/workflows/python-publish.yml +0 -0
  16. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/.gitignore +0 -0
  17. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/AGENTS.md +0 -0
  18. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/CLAUDE.md +0 -0
  19. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/LICENSE +0 -0
  20. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/pytest.ini +0 -0
  21. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/src/python_qube_heatpump/__init__.py +0 -0
  22. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/src/python_qube_heatpump/const.py +0 -0
  23. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/src/python_qube_heatpump/entities/__init__.py +0 -0
  24. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/src/python_qube_heatpump/entities/binary_sensors.py +0 -0
  25. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/src/python_qube_heatpump/entities/switches.py +0 -0
  26. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/src/python_qube_heatpump/models.py +0 -0
  27. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/src/python_qube_heatpump/py.typed +0 -0
  28. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/tests/conftest.py +0 -0
  29. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/tests/test_const.py +0 -0
  30. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/tests/test_entities.py +0 -0
  31. {python_qube_heatpump-1.4.7 → python_qube_heatpump-1.4.9}/tests/test_models.py +0 -0
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-qube-heatpump
3
+ Version: 1.4.9
4
+ Summary: Async Modbus client for Qube Heat Pumps
5
+ Project-URL: Homepage, https://github.com/MattieGit/python-qube-heatpump
6
+ Project-URL: Bug Tracker, https://github.com/MattieGit/python-qube-heatpump/issues
7
+ Author-email: MattieGit <6250046+MattieGit@users.noreply.github.com>
8
+ License-File: LICENSE
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.12
13
+ Requires-Dist: pymodbus>=3.11.0
14
+ Provides-Extra: test
15
+ Requires-Dist: pytest; extra == 'test'
16
+ Requires-Dist: pytest-asyncio; extra == 'test'
17
+ Requires-Dist: pytest-mock; extra == 'test'
18
+ Description-Content-Type: text/markdown
19
+
20
+ # Python Qube Heat Pump Client
21
+
22
+ Asyncio client for Qube heat pumps via Modbus TCP.
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ pip install python-qube-heatpump
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ```python
33
+ import asyncio
34
+ from python_qube_heatpump import QubeClient
35
+
36
+ async def main():
37
+ client = QubeClient("192.168.1.100", port=502, unit_id=1)
38
+ await client.connect()
39
+
40
+ state = await client.read_state()
41
+ print(f"Outside temp: {state.temp_outside}°C")
42
+ print(f"Supply temp: {state.temp_supply}°C")
43
+ print(f"DHW temp: {state.temp_dhw}°C")
44
+
45
+ await client.disconnect()
46
+
47
+ asyncio.run(main())
48
+ ```
49
+
50
+ ## Features
51
+
52
+ - **Async Modbus TCP client** using pymodbus
53
+ - **Entity definitions** for sensors, binary sensors, and switches
54
+ - **FLOAT32 decoding** with big endian (ABCD) byte order
55
+ - **Type-safe dataclasses** for entity definitions
56
+
57
+ ## Entity Definitions
58
+
59
+ The library provides pre-defined entity definitions for all Qube Modbus registers:
60
+
61
+ ```python
62
+ from python_qube_heatpump.entities import SENSORS, BINARY_SENSORS, SWITCHES
63
+
64
+ # Access entity definitions by key
65
+ temp_supply = SENSORS["temp_supply"]
66
+ print(f"Address: {temp_supply.address}, Unit: {temp_supply.unit}")
67
+ ```
68
+
69
+ ## Vendor Documentation
70
+
71
+ The official Modbus register documentation from HR-Energy is available at:
72
+ - [docs/202506_modbus-lijst-qube.pdf](docs/202506_modbus-lijst-qube.pdf) (included in this repo)
73
+ - [HR-Energy website](https://www.hr-energy.com/media/m4gavc0p/202506_modbus-lijst-qube.pdf)
74
+
75
+ ## Related Projects
76
+
77
+ - [qube_heatpump](https://github.com/MattieGit/qube_heatpump) - Home Assistant HACS integration using this library
78
+
79
+ ## License
80
+
81
+ MIT License
@@ -0,0 +1,62 @@
1
+ # Python Qube Heat Pump Client
2
+
3
+ Asyncio client for Qube heat pumps via Modbus TCP.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install python-qube-heatpump
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```python
14
+ import asyncio
15
+ from python_qube_heatpump import QubeClient
16
+
17
+ async def main():
18
+ client = QubeClient("192.168.1.100", port=502, unit_id=1)
19
+ await client.connect()
20
+
21
+ state = await client.read_state()
22
+ print(f"Outside temp: {state.temp_outside}°C")
23
+ print(f"Supply temp: {state.temp_supply}°C")
24
+ print(f"DHW temp: {state.temp_dhw}°C")
25
+
26
+ await client.disconnect()
27
+
28
+ asyncio.run(main())
29
+ ```
30
+
31
+ ## Features
32
+
33
+ - **Async Modbus TCP client** using pymodbus
34
+ - **Entity definitions** for sensors, binary sensors, and switches
35
+ - **FLOAT32 decoding** with big endian (ABCD) byte order
36
+ - **Type-safe dataclasses** for entity definitions
37
+
38
+ ## Entity Definitions
39
+
40
+ The library provides pre-defined entity definitions for all Qube Modbus registers:
41
+
42
+ ```python
43
+ from python_qube_heatpump.entities import SENSORS, BINARY_SENSORS, SWITCHES
44
+
45
+ # Access entity definitions by key
46
+ temp_supply = SENSORS["temp_supply"]
47
+ print(f"Address: {temp_supply.address}, Unit: {temp_supply.unit}")
48
+ ```
49
+
50
+ ## Vendor Documentation
51
+
52
+ The official Modbus register documentation from HR-Energy is available at:
53
+ - [docs/202506_modbus-lijst-qube.pdf](docs/202506_modbus-lijst-qube.pdf) (included in this repo)
54
+ - [HR-Energy website](https://www.hr-energy.com/media/m4gavc0p/202506_modbus-lijst-qube.pdf)
55
+
56
+ ## Related Projects
57
+
58
+ - [qube_heatpump](https://github.com/MattieGit/qube_heatpump) - Home Assistant HACS integration using this library
59
+
60
+ ## License
61
+
62
+ MIT License
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "python-qube-heatpump"
7
- version = "1.4.7"
7
+ version = "1.4.9"
8
8
  authors = [
9
9
  { name="MattieGit", email="6250046+MattieGit@users.noreply.github.com" },
10
10
  ]
@@ -281,6 +281,10 @@ class QubeClient:
281
281
  if entity.offset is not None:
282
282
  val = val + entity.offset
283
283
 
284
+ # Apply precision rounding if specified
285
+ if entity.precision is not None and isinstance(val, float):
286
+ val = round(val, entity.precision)
287
+
284
288
  return val
285
289
 
286
290
  except Exception as e:
@@ -448,7 +452,9 @@ class QubeClient:
448
452
  entity.address, int(write_value), device_id=self.unit
449
453
  )
450
454
  else:
451
- _LOGGER.warning("Unsupported data type for writing: %s", entity.data_type)
455
+ _LOGGER.warning(
456
+ "Unsupported data type for writing: %s", entity.data_type
457
+ )
452
458
  return False
453
459
 
454
460
  if result.isError():
@@ -75,3 +75,7 @@ class EntityDef:
75
75
  # Write capability
76
76
  writable: bool = False
77
77
  """Whether this entity can be written to."""
78
+
79
+ # Value precision
80
+ precision: int | None = None
81
+ """Number of decimal places to round to. None for no rounding."""
@@ -244,6 +244,7 @@ _SENSOR_DEFS: tuple[EntityDef, ...] = (
244
244
  input_type=InputType.INPUT_REGISTER,
245
245
  data_type=DataType.FLOAT32,
246
246
  platform=Platform.SENSOR,
247
+ precision=1,
247
248
  ),
248
249
  EntityDef(
249
250
  key="power_thermic",
@@ -24,13 +24,12 @@ async def test_read_value(mock_modbus_client):
24
24
  mock_instance.connected = True
25
25
 
26
26
  # Mock response for reading holding registers (FLOAT32)
27
- # 24.5 = 0x41C40000 -> 16836 (0x41C4), 0 (0x0000) (Big Endian)
28
- # Our decoder expects [0, 16836] for Little Endian Word Order?
29
- # Logic in client.py: int_val = (regs[1] << 16) | regs[0]
30
- # To get 0x41C40000: regs[1]=0x41C4, regs[0]=0x0000
27
+ # 24.5 = 0x41C40000 -> Big Endian word order (ABCD)
28
+ # Logic in client.py: int_val = (regs[0] << 16) | regs[1]
29
+ # regs[0]=0x41C4=16836 (MSW), regs[1]=0x0000=0 (LSW)
31
30
  mock_resp = MagicMock()
32
31
  mock_resp.isError.return_value = False
33
- mock_resp.registers = [0, 16836]
32
+ mock_resp.registers = [16836, 0]
34
33
 
35
34
  mock_instance.read_holding_registers = AsyncMock(return_value=mock_resp)
36
35
  client._client = mock_instance
@@ -80,10 +79,11 @@ async def test_read_sensor(mock_modbus_client):
80
79
  mock_instance = mock_modbus_client.return_value
81
80
 
82
81
  # Mock response for temp_supply (FLOAT32) = 35.5°C
83
- # 35.5 = 0x420E0000 -> regs[1]=0x420E=16910, regs[0]=0x0000
82
+ # 35.5 = 0x420E0000 -> Big Endian word order (ABCD)
83
+ # regs[0]=0x420E=16910 (MSW), regs[1]=0x0000=0 (LSW)
84
84
  mock_resp = MagicMock()
85
85
  mock_resp.isError.return_value = False
86
- mock_resp.registers = [0, 16910]
86
+ mock_resp.registers = [16910, 0]
87
87
 
88
88
  mock_instance.read_input_registers = AsyncMock(return_value=mock_resp)
89
89
  client._client = mock_instance
@@ -1,27 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: python-qube-heatpump
3
- Version: 1.4.7
4
- Summary: Async Modbus client for Qube Heat Pumps
5
- Project-URL: Homepage, https://github.com/MattieGit/python-qube-heatpump
6
- Project-URL: Bug Tracker, https://github.com/MattieGit/python-qube-heatpump/issues
7
- Author-email: MattieGit <6250046+MattieGit@users.noreply.github.com>
8
- License-File: LICENSE
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Programming Language :: Python :: 3
12
- Requires-Python: >=3.12
13
- Requires-Dist: pymodbus>=3.11.0
14
- Provides-Extra: test
15
- Requires-Dist: pytest; extra == 'test'
16
- Requires-Dist: pytest-asyncio; extra == 'test'
17
- Requires-Dist: pytest-mock; extra == 'test'
18
- Description-Content-Type: text/markdown
19
-
20
- <<<<<<< HEAD
21
- # python-qube-heatpump
22
- Library for Qube heatpump connection
23
- =======
24
- # Python Qube Heat Pump Client
25
-
26
- Asyncio client for Qube heat pumps via Modbus TCP.
27
- >>>>>>> 8c36d4a (Initial commit)
@@ -1,8 +0,0 @@
1
- <<<<<<< HEAD
2
- # python-qube-heatpump
3
- Library for Qube heatpump connection
4
- =======
5
- # Python Qube Heat Pump Client
6
-
7
- Asyncio client for Qube heat pumps via Modbus TCP.
8
- >>>>>>> 8c36d4a (Initial commit)