aiobmsble 0.1.0__py3-none-any.whl → 0.2.1__py3-none-any.whl
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.
- aiobmsble/__init__.py +53 -8
- aiobmsble/__main__.py +51 -27
- aiobmsble/basebms.py +266 -50
- aiobmsble/bms/__init__.py +1 -0
- aiobmsble/bms/abc_bms.py +164 -0
- aiobmsble/bms/ant_bms.py +196 -0
- aiobmsble/bms/braunpwr_bms.py +167 -0
- aiobmsble/bms/cbtpwr_bms.py +168 -0
- aiobmsble/bms/cbtpwr_vb_bms.py +184 -0
- aiobmsble/bms/daly_bms.py +164 -0
- aiobmsble/bms/dpwrcore_bms.py +207 -0
- aiobmsble/bms/dummy_bms.py +89 -0
- aiobmsble/bms/ecoworthy_bms.py +151 -0
- aiobmsble/bms/ective_bms.py +177 -0
- aiobmsble/bms/ej_bms.py +233 -0
- aiobmsble/bms/felicity_bms.py +139 -0
- aiobmsble/bms/jbd_bms.py +203 -0
- aiobmsble/bms/jikong_bms.py +301 -0
- aiobmsble/bms/neey_bms.py +214 -0
- aiobmsble/bms/ogt_bms.py +214 -0
- aiobmsble/bms/pro_bms.py +144 -0
- aiobmsble/bms/redodo_bms.py +127 -0
- aiobmsble/bms/renogy_bms.py +149 -0
- aiobmsble/bms/renogy_pro_bms.py +105 -0
- aiobmsble/bms/roypow_bms.py +186 -0
- aiobmsble/bms/seplos_bms.py +245 -0
- aiobmsble/bms/seplos_v2_bms.py +205 -0
- aiobmsble/bms/tdt_bms.py +199 -0
- aiobmsble/bms/tianpwr_bms.py +138 -0
- aiobmsble/utils.py +96 -6
- {aiobmsble-0.1.0.dist-info → aiobmsble-0.2.1.dist-info}/METADATA +23 -14
- aiobmsble-0.2.1.dist-info/RECORD +36 -0
- {aiobmsble-0.1.0.dist-info → aiobmsble-0.2.1.dist-info}/WHEEL +1 -1
- aiobmsble-0.1.0.dist-info/RECORD +0 -10
- {aiobmsble-0.1.0.dist-info → aiobmsble-0.2.1.dist-info}/entry_points.txt +0 -0
- {aiobmsble-0.1.0.dist-info → aiobmsble-0.2.1.dist-info}/licenses/LICENSE +0 -0
- {aiobmsble-0.1.0.dist-info → aiobmsble-0.2.1.dist-info}/top_level.txt +0 -0
@@ -1,12 +1,14 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: aiobmsble
|
3
|
-
Version: 0.1
|
3
|
+
Version: 0.2.1
|
4
4
|
Summary: Asynchronous Python library to query battery management systems via Bluetooth Low Energy.
|
5
5
|
Author: Patrick Loschmidt
|
6
6
|
Maintainer: Patrick Loschmidt
|
7
7
|
License-Expression: Apache-2.0
|
8
8
|
Project-URL: Homepage, https://github.com/patman15/aiobmsble/
|
9
|
-
Project-URL: Documentation, https://github.com/patman15/aiobmsble/
|
9
|
+
Project-URL: Documentation, https://github.com/patman15/aiobmsble/README
|
10
|
+
Project-URL: Source Code, https://github.com/patman15/aiobmsble/
|
11
|
+
Project-URL: Bug Reports, https://github.com/patman15/aiobmsble/issues
|
10
12
|
Keywords: BMS,BLE,battery,bluetooth
|
11
13
|
Classifier: Programming Language :: Python :: 3
|
12
14
|
Classifier: Operating System :: OS Independent
|
@@ -16,8 +18,8 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
16
18
|
Requires-Python: >=3.12
|
17
19
|
Description-Content-Type: text/markdown
|
18
20
|
License-File: LICENSE
|
19
|
-
Requires-Dist: bleak~=
|
20
|
-
Requires-Dist: bleak-retry-connector~=
|
21
|
+
Requires-Dist: bleak~=1.1.0
|
22
|
+
Requires-Dist: bleak-retry-connector~=4.0.2
|
21
23
|
Requires-Dist: asyncio
|
22
24
|
Requires-Dist: logging
|
23
25
|
Requires-Dist: statistics
|
@@ -26,6 +28,8 @@ Provides-Extra: dev
|
|
26
28
|
Requires-Dist: pytest; extra == "dev"
|
27
29
|
Requires-Dist: pytest-asyncio; extra == "dev"
|
28
30
|
Requires-Dist: pytest-cov; extra == "dev"
|
31
|
+
Requires-Dist: pytest-xdist; extra == "dev"
|
32
|
+
Requires-Dist: hypothesis; extra == "dev"
|
29
33
|
Requires-Dist: mypy; extra == "dev"
|
30
34
|
Requires-Dist: ruff; extra == "dev"
|
31
35
|
Dynamic: license-file
|
@@ -35,9 +39,8 @@ Dynamic: license-file
|
|
35
39
|
# Aiobmsble
|
36
40
|
Requires Python 3 and uses [asyncio](https://pypi.org/project/asyncio/) and [bleak](https://pypi.org/project/bleak/)
|
37
41
|
> [!IMPORTANT]
|
38
|
-
> At the moment the library is under development and
|
42
|
+
> At the moment the library is under development and there might be missing functionality compared to the [BMS_BLE-HA integration](https://github.com/patman15/BMS_BLE-HA/)!
|
39
43
|
> Please do not (yet) report missing BMS support or bugs here. Instead please raise an issue at the integration till the library reached at least development status *beta*.
|
40
|
-
> Plan is to support all BMSs that are listed [here](https://github.com/patman15/BMS_BLE-HA/edit/main/README.md#supported-devices).
|
41
44
|
|
42
45
|
## Asynchronous Library to Query Battery Management Systems via Bluetooth LE
|
43
46
|
This library is intended to query data from battery management systems that use Bluetooth LE. It is developed to support [BMS_BLE-HA integration](https://github.com/patman15/BMS_BLE-HA/) that was written to make BMS data available to Home Assistant. While the integration depends on Home Assistant, this library can be used stand-alone in any Python environment (with necessary dependencies installed).
|
@@ -55,6 +58,7 @@ This example can also be found as an [example](/examples/minimal.py) in the resp
|
|
55
58
|
"""Example of using the aiobmsble library to find a BLE device by name and print its senosr data."""
|
56
59
|
|
57
60
|
import asyncio
|
61
|
+
import logging
|
58
62
|
from typing import Final
|
59
63
|
|
60
64
|
from bleak import BleakScanner
|
@@ -62,30 +66,35 @@ from bleak.backends.device import BLEDevice
|
|
62
66
|
from bleak.exc import BleakError
|
63
67
|
|
64
68
|
from aiobmsble import BMSsample
|
65
|
-
from aiobmsble.bms.
|
69
|
+
from aiobmsble.bms.dummy_bms import BMS # use the right BMS class for your device
|
66
70
|
|
67
71
|
NAME: Final[str] = "BT Device Name" # Replace with the name of your BLE device
|
68
72
|
|
73
|
+
# Configure logging
|
74
|
+
logging.basicConfig(level=logging.INFO)
|
75
|
+
logger: logging.Logger = logging.getLogger(__name__)
|
76
|
+
|
69
77
|
|
70
78
|
async def main(dev_name) -> None:
|
71
|
-
"""
|
79
|
+
"""Find a BLE device by name and update its sensor data."""
|
72
80
|
|
73
81
|
device: BLEDevice | None = await BleakScanner.find_device_by_name(dev_name)
|
74
82
|
if device is None:
|
75
|
-
|
83
|
+
logger.error("Device '%s' not found.", dev_name)
|
76
84
|
return
|
77
85
|
|
78
|
-
|
86
|
+
logger.info("Found device: %s (%s)", device.name, device.address)
|
79
87
|
bms = BMS(ble_device=device, reconnect=True)
|
80
88
|
try:
|
81
|
-
|
89
|
+
logger.info("Updating BMS data...")
|
82
90
|
data: BMSsample = await bms.async_update()
|
83
|
-
|
91
|
+
logger.info("BMS data: %s", repr(data).replace(", ", ",\n\t"))
|
84
92
|
except BleakError as ex:
|
85
|
-
|
93
|
+
logger.error("Failed to update BMS: %s", type(ex).__name__)
|
86
94
|
|
87
95
|
|
88
|
-
|
96
|
+
if __name__ == "__main__":
|
97
|
+
asyncio.run(main(NAME)) # pragma: no cover
|
89
98
|
```
|
90
99
|
|
91
100
|
## Installation
|
@@ -0,0 +1,36 @@
|
|
1
|
+
aiobmsble/__init__.py,sha256=gwWO0ojesAR4aYsu5P4LZYlaQgkJpMkzg4Q27V3VOrg,2932
|
2
|
+
aiobmsble/__main__.py,sha256=7h8ZnUlQ67IMjnRMJJt091ndGIrYuvd5i12OEMxy2j0,3000
|
3
|
+
aiobmsble/basebms.py,sha256=bNik9TsHTlAqAR-RPxFFXy6qD1E7l7f53u8wffMgQyU,18556
|
4
|
+
aiobmsble/utils.py,sha256=sXAiXncVWLdO-7q9tbwaEbCKf4ciNrRQZEExbxFqwkk,5518
|
5
|
+
aiobmsble/bms/__init__.py,sha256=YAtb8MKhgbZP528ISmxwfXtDix7G_3xuREdcDPvDvqo,60
|
6
|
+
aiobmsble/bms/abc_bms.py,sha256=1EISRUQ_owkgMAjuX8nGZav7cGdE3IFSpQXVndN8ZdA,5887
|
7
|
+
aiobmsble/bms/ant_bms.py,sha256=vb7886qYPU1Rpr-lkGfcMwybySz1bLgAnDGrfnU498U,7054
|
8
|
+
aiobmsble/bms/braunpwr_bms.py,sha256=yI82UqJHgS_yKycbTLyBArQo7e8HjFwCnMZG-OlUcHE,5871
|
9
|
+
aiobmsble/bms/cbtpwr_bms.py,sha256=d5rTZwZNkhB4Lx2qlilPFPLITweBOGwCyzfwKeXBw-I,6171
|
10
|
+
aiobmsble/bms/cbtpwr_vb_bms.py,sha256=2NpwkyUueORVijhywYG_RTRbX_EbLHChS8vPCTLzPo0,6520
|
11
|
+
aiobmsble/bms/daly_bms.py,sha256=ebOTBiC9PQNEs7RRw8pyNnWW4zE0rgGK_WD0IOVjvt8,5744
|
12
|
+
aiobmsble/bms/dpwrcore_bms.py,sha256=Mt5ZyucPCvn-lWAilKsDxjvrkT123t_cSQ9M8jMEFyo,6560
|
13
|
+
aiobmsble/bms/dummy_bms.py,sha256=M6H0o2h2g3LHW-e2JmMMH2RwvviLWu2OuVTAjCd1Nxc,3399
|
14
|
+
aiobmsble/bms/ecoworthy_bms.py,sha256=u0ysJmRAVEkNwVFG4jzl2yoA4JuRjGgDN-G84rVrjw4,5304
|
15
|
+
aiobmsble/bms/ective_bms.py,sha256=wDwV8EBRFD8s4819d0fxBZ0jUgT1T7Edgn7TmhDCk4M,5745
|
16
|
+
aiobmsble/bms/ej_bms.py,sha256=Nu8R-SaqYhM57y2qCJ-ryQfJ9OZTCj7NriiJXBuJWDc,7923
|
17
|
+
aiobmsble/bms/felicity_bms.py,sha256=RNNTxJmpj-oqi_-ec2BV82I5Yw5olvnO5KMO6ssrOXU,4632
|
18
|
+
aiobmsble/bms/jbd_bms.py,sha256=3W2AFwnRZQ1IT5BFeWOJDQ3ZsXaxquABw34g3pBTGAc,7061
|
19
|
+
aiobmsble/bms/jikong_bms.py,sha256=4-xqd3AxmsDYwHDNtKADi-d2lU9ZiHtcvWpSBE1rlOE,11047
|
20
|
+
aiobmsble/bms/neey_bms.py,sha256=NU8qDaPO90hQD3kC9w-xoc1v0eLzLM_g-OfeI4bzwxw,7560
|
21
|
+
aiobmsble/bms/ogt_bms.py,sha256=k-3FlBMeEZInUqYrAFfI38t9VuKsn7k64etlvyjtIoo,7882
|
22
|
+
aiobmsble/bms/pro_bms.py,sha256=64tnmZYxz6fK1fUg6A9x3yNjeYTwEpOQL6Zi-w4bbqU,4973
|
23
|
+
aiobmsble/bms/redodo_bms.py,sha256=qxPDCPNiDl_Iq1MDMiG3ZzoAxRHqPXkydzt4DpPLvAs,4264
|
24
|
+
aiobmsble/bms/renogy_bms.py,sha256=ua_1mEJANyy4qJIo53Upaa47_soL4WrmeRHErG5eaZU,5027
|
25
|
+
aiobmsble/bms/renogy_pro_bms.py,sha256=jTxmeAkSjbJjuhtwB1AFZp_dxDCs8ofCJZlBMwMcLUw,3863
|
26
|
+
aiobmsble/bms/roypow_bms.py,sha256=3JGIUY91wzBroS_f0NhBF3jj9XJTniENFcSOaGmMipQ,6063
|
27
|
+
aiobmsble/bms/seplos_bms.py,sha256=BLKna81ocFGoJ2E2nfMU7NGvJXSICapggk_fjS_vKBw,9412
|
28
|
+
aiobmsble/bms/seplos_v2_bms.py,sha256=3bkZce8wxxG-0InOIPPa-1y6fR2GuZomNQI65ypyJ_s,7388
|
29
|
+
aiobmsble/bms/tdt_bms.py,sha256=4P52WRikQLqu6mN40I_upVpmEDKA5gS472EbjhJ7n-Q,6927
|
30
|
+
aiobmsble/bms/tianpwr_bms.py,sha256=SKS31KOHVXnvXbPtSAWPUdiI4j8bV7Y9bwRkrpKWZDw,4841
|
31
|
+
aiobmsble-0.2.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
32
|
+
aiobmsble-0.2.1.dist-info/METADATA,sha256=Q3p5fiUxVeWt7z2XjztBI--mTbkhCa7ip3W7c-dv2pI,4711
|
33
|
+
aiobmsble-0.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
34
|
+
aiobmsble-0.2.1.dist-info/entry_points.txt,sha256=HSC_C3nQikc3nk0a6mcG92RuIM7wAzozjBVfDojJceo,54
|
35
|
+
aiobmsble-0.2.1.dist-info/top_level.txt,sha256=YHBVzg45mJ3vPz0sl_TpMB0edMqqhD61kwJj4EPAk9g,10
|
36
|
+
aiobmsble-0.2.1.dist-info/RECORD,,
|
aiobmsble-0.1.0.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
aiobmsble/__init__.py,sha256=qEmiX9i7aKK7lYl7zrTgNFblb3-WJYTG22tTmAO_uC4,1541
|
2
|
-
aiobmsble/__main__.py,sha256=ycvwDkcph4M1UzsBGJzkQWkLS6CW5sPfEG9QK-Q691I,2102
|
3
|
-
aiobmsble/basebms.py,sha256=ZHG34fmDQ5wz58GpS7yI09ICdot7iyvdhPg6zt9U6vw,10699
|
4
|
-
aiobmsble/utils.py,sha256=BGcwcfOpS5KW942J7uHRrBkmh9rdMW64OvDRyHIP9lQ,2535
|
5
|
-
aiobmsble-0.1.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
6
|
-
aiobmsble-0.1.0.dist-info/METADATA,sha256=THqATDPH5bBlgIb363ZpqCkOh5S4FPYkQSPnPDW4xdE,4395
|
7
|
-
aiobmsble-0.1.0.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
8
|
-
aiobmsble-0.1.0.dist-info/entry_points.txt,sha256=HSC_C3nQikc3nk0a6mcG92RuIM7wAzozjBVfDojJceo,54
|
9
|
-
aiobmsble-0.1.0.dist-info/top_level.txt,sha256=YHBVzg45mJ3vPz0sl_TpMB0edMqqhD61kwJj4EPAk9g,10
|
10
|
-
aiobmsble-0.1.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|