aiobmsble 0.2.3__py3-none-any.whl → 0.4__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.
Files changed (64) hide show
  1. aiobmsble/__init__.py +2 -0
  2. aiobmsble/__main__.py +4 -2
  3. aiobmsble/basebms.py +40 -15
  4. aiobmsble/bms/abc_bms.py +2 -2
  5. aiobmsble/bms/ant_bms.py +4 -3
  6. aiobmsble/bms/ant_leg_bms.py +177 -0
  7. aiobmsble/bms/braunpwr_bms.py +2 -2
  8. aiobmsble/bms/cbtpwr_bms.py +2 -2
  9. aiobmsble/bms/cbtpwr_vb_bms.py +2 -2
  10. aiobmsble/bms/daly_bms.py +2 -2
  11. aiobmsble/bms/dpwrcore_bms.py +2 -2
  12. aiobmsble/bms/dummy_bms.py +3 -3
  13. aiobmsble/bms/ecoworthy_bms.py +2 -2
  14. aiobmsble/bms/ective_bms.py +2 -2
  15. aiobmsble/bms/ej_bms.py +9 -3
  16. aiobmsble/bms/felicity_bms.py +2 -2
  17. aiobmsble/bms/jbd_bms.py +2 -2
  18. aiobmsble/bms/jikong_bms.py +2 -2
  19. aiobmsble/bms/neey_bms.py +2 -2
  20. aiobmsble/bms/ogt_bms.py +2 -2
  21. aiobmsble/bms/pro_bms.py +2 -2
  22. aiobmsble/bms/redodo_bms.py +5 -2
  23. aiobmsble/bms/renogy_bms.py +2 -2
  24. aiobmsble/bms/renogy_pro_bms.py +2 -2
  25. aiobmsble/bms/roypow_bms.py +2 -2
  26. aiobmsble/bms/seplos_bms.py +3 -3
  27. aiobmsble/bms/seplos_v2_bms.py +2 -2
  28. aiobmsble/bms/tdt_bms.py +2 -2
  29. aiobmsble/bms/tianpwr_bms.py +2 -2
  30. aiobmsble/test_data/__init__.py +95 -0
  31. aiobmsble/test_data/abc_bms.json +34 -0
  32. aiobmsble/test_data/ant_bms.json +18 -0
  33. aiobmsble/test_data/ant_leg_bms.json +19 -0
  34. aiobmsble/test_data/braunpwr_bms.json +34 -0
  35. aiobmsble/test_data/cbtpwr_bms.json +90 -0
  36. aiobmsble/test_data/cbtpwr_vb_bms.json +20 -0
  37. aiobmsble/test_data/daly_bms.json +100 -0
  38. aiobmsble/test_data/dpwrcore_bms.json +18 -0
  39. aiobmsble/test_data/ecoworthy_bms.json +100 -0
  40. aiobmsble/test_data/ective_bms.json +104 -0
  41. aiobmsble/test_data/ej_bms.json +107 -0
  42. aiobmsble/test_data/felicity_bms.json +24 -0
  43. aiobmsble/test_data/ignore.json +48 -0
  44. aiobmsble/test_data/jbd_bms.json +440 -0
  45. aiobmsble/test_data/jikong_bms.json +54 -0
  46. aiobmsble/test_data/neey_bms.json +65 -0
  47. aiobmsble/test_data/ogt_bms.json +16 -0
  48. aiobmsble/test_data/pro_bms.json +15 -0
  49. aiobmsble/test_data/redodo_bms.json +151 -0
  50. aiobmsble/test_data/renogy_bms.json +19 -0
  51. aiobmsble/test_data/renogy_pro_bms.json +16 -0
  52. aiobmsble/test_data/roypow_bms.json +54 -0
  53. aiobmsble/test_data/seplos_bms.json +96 -0
  54. aiobmsble/test_data/seplos_v2_bms.json +41 -0
  55. aiobmsble/test_data/tdt_bms.json +14 -0
  56. aiobmsble/test_data/tianpwr_bms.json +13 -0
  57. aiobmsble-0.4.dist-info/METADATA +163 -0
  58. aiobmsble-0.4.dist-info/RECORD +64 -0
  59. aiobmsble-0.2.3.dist-info/METADATA +0 -122
  60. aiobmsble-0.2.3.dist-info/RECORD +0 -36
  61. {aiobmsble-0.2.3.dist-info → aiobmsble-0.4.dist-info}/WHEEL +0 -0
  62. {aiobmsble-0.2.3.dist-info → aiobmsble-0.4.dist-info}/entry_points.txt +0 -0
  63. {aiobmsble-0.2.3.dist-info → aiobmsble-0.4.dist-info}/licenses/LICENSE +0 -0
  64. {aiobmsble-0.2.3.dist-info → aiobmsble-0.4.dist-info}/top_level.txt +0 -0
@@ -1,122 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: aiobmsble
3
- Version: 0.2.3
4
- Summary: Asynchronous Python library to query battery management systems via Bluetooth Low Energy.
5
- Author: Patrick Loschmidt
6
- Maintainer: Patrick Loschmidt
7
- License-Expression: Apache-2.0
8
- Project-URL: Homepage, 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
12
- Keywords: BMS,BLE,battery,bluetooth
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Operating System :: OS Independent
15
- Classifier: Development Status :: 3 - Alpha
16
- Classifier: Intended Audience :: Developers
17
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
- Requires-Python: >=3.12
19
- Description-Content-Type: text/markdown
20
- License-File: LICENSE
21
- Requires-Dist: bleak~=1.1.0
22
- Requires-Dist: bleak-retry-connector>=4.0.2
23
- Requires-Dist: asyncio
24
- Requires-Dist: logging
25
- Requires-Dist: statistics
26
- Requires-Dist: typing
27
- Provides-Extra: dev
28
- Requires-Dist: pytest; extra == "dev"
29
- Requires-Dist: pytest-asyncio; extra == "dev"
30
- Requires-Dist: pytest-cov; extra == "dev"
31
- Requires-Dist: pytest-xdist; extra == "dev"
32
- Requires-Dist: hypothesis; extra == "dev"
33
- Requires-Dist: mypy; extra == "dev"
34
- Requires-Dist: ruff; extra == "dev"
35
- Dynamic: license-file
36
-
37
- [![License][license-shield]](LICENSE)
38
-
39
- # Aiobmsble
40
- Requires Python 3 and uses [asyncio](https://pypi.org/project/asyncio/) and [bleak](https://pypi.org/project/bleak/)
41
- > [!IMPORTANT]
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/)!
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*.
44
-
45
- ## Asynchronous Library to Query Battery Management Systems via Bluetooth LE
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).
47
-
48
- ## Usage
49
- In order to identify all devices that are reachable and supported by the library, simply run
50
- ```bash
51
- aiobmsble
52
- ```
53
- from the command line after [installation](#installation). In case you need the code as reference, please see [\_\_main\_\_.py](/aiobmsble/__main__.py).
54
-
55
- ### From a Script
56
- This example can also be found as an [example](/examples/minimal.py) in the respective [folder](/main/examples).
57
- ```python
58
- """Example of using the aiobmsble library to find a BLE device by name and print its senosr data."""
59
-
60
- import asyncio
61
- import logging
62
- from typing import Final
63
-
64
- from bleak import BleakScanner
65
- from bleak.backends.device import BLEDevice
66
- from bleak.exc import BleakError
67
-
68
- from aiobmsble import BMSsample
69
- from aiobmsble.bms.dummy_bms import BMS # use the right BMS class for your device
70
-
71
- NAME: Final[str] = "BT Device Name" # Replace with the name of your BLE device
72
-
73
- # Configure logging
74
- logging.basicConfig(level=logging.INFO)
75
- logger: logging.Logger = logging.getLogger(__name__)
76
-
77
-
78
- async def main(dev_name) -> None:
79
- """Find a BLE device by name and update its sensor data."""
80
-
81
- device: BLEDevice | None = await BleakScanner.find_device_by_name(dev_name)
82
- if device is None:
83
- logger.error("Device '%s' not found.", dev_name)
84
- return
85
-
86
- logger.info("Found device: %s (%s)", device.name, device.address)
87
- bms = BMS(ble_device=device, reconnect=True)
88
- try:
89
- logger.info("Updating BMS data...")
90
- data: BMSsample = await bms.async_update()
91
- logger.info("BMS data: %s", repr(data).replace(", ", ",\n\t"))
92
- except BleakError as ex:
93
- logger.error("Failed to update BMS: %s", type(ex).__name__)
94
-
95
-
96
- if __name__ == "__main__":
97
- asyncio.run(main(NAME)) # pragma: no cover
98
- ```
99
-
100
- ## Installation
101
- Install python and pip if you have not already, then run:
102
- ```bash
103
- pip3 install pip --upgrade
104
- pip3 install wheel
105
- ```
106
-
107
- ### For Production:
108
-
109
- ```bash
110
- pip3 install aiobmsble
111
- ```
112
- This will install the latest library release and all of it's python dependencies.
113
-
114
- ### For Development:
115
- ```bash
116
- git clone https://github.com/patman15/aiobmsble.git
117
- cd aiobmsble
118
- pip3 install -e .[dev]
119
- ```
120
- This gives you the latest library code from the main branch.
121
-
122
- [license-shield]: https://img.shields.io/github/license/patman15/aiobmsble.svg?style=for-the-badge&cacheSeconds=86400
@@ -1,36 +0,0 @@
1
- aiobmsble/__init__.py,sha256=zIqeiJBneqIUo61GIeqHh0gt9itp19OierNrMLEw25Y,3049
2
- aiobmsble/__main__.py,sha256=swsFTPO4Cz8fsFwfGfjCv0M6EI9g8VDhC-5HaCo-spI,3113
3
- aiobmsble/basebms.py,sha256=pPhzj6pJUFtVnbHR5bauRi4BpuWJwQ9GXFueEDCVIZw,18813
4
- aiobmsble/utils.py,sha256=ckcOXMLTpm4oCxbGKco88cPVP4nOgiTJ16ebFlvsj_E,5805
5
- aiobmsble/bms/__init__.py,sha256=ZE4Uezyd5fs3os4_bt6Pnzsfrp38LTXItdvJ9-zBiR0,165
6
- aiobmsble/bms/abc_bms.py,sha256=wud4DTj5Cbo9CjsQ96Tn12CXOSoozvKTIa9pWGpEo1s,5992
7
- aiobmsble/bms/ant_bms.py,sha256=3YY3Nod6KhylBqYFo2vDgy76MpdYtKbckzDC0SDoEZM,7159
8
- aiobmsble/bms/braunpwr_bms.py,sha256=_Fl9yQQtzmQyveCQNso6ahX0O1PHxrf5LL4Ef7k5GHg,5976
9
- aiobmsble/bms/cbtpwr_bms.py,sha256=p4bS3oyVirUFC2-2nbF2EfCrShx8ynpjXEkLPdC0llA,6276
10
- aiobmsble/bms/cbtpwr_vb_bms.py,sha256=AJhesOKX2yzrsfXQcXufG9E7iX2YJMo-syLKwSMeMLw,6625
11
- aiobmsble/bms/daly_bms.py,sha256=Ql7Ajv06OSp0m_16vcUy9y_W1JeLOPFWChghD0xr59U,5849
12
- aiobmsble/bms/dpwrcore_bms.py,sha256=6o4cKtEs8_Fic_se7W32BXlP9K5d3T4_CHiNnnFnMHo,6665
13
- aiobmsble/bms/dummy_bms.py,sha256=1OvcZByFAPtHhz53JyAaDVZ02a1JkCissTRHQKcYyog,3504
14
- aiobmsble/bms/ecoworthy_bms.py,sha256=VL3pbU1AtrNBwAIlhjinTiy86Lu8ITvwe55A66GXwGU,5409
15
- aiobmsble/bms/ective_bms.py,sha256=jvkXaJe0_MvHeV8BiDg7oxCzT_z0WvBvuxybzbbY8Sk,5850
16
- aiobmsble/bms/ej_bms.py,sha256=B8KWs0Py91TrvvxLKIIwgQ5ppkeQtq8tsQ024jQCeKA,8028
17
- aiobmsble/bms/felicity_bms.py,sha256=RPTvmnDuedErIiVKdsUR-w8zhF7_IOj_gmk7A2VIHTo,4737
18
- aiobmsble/bms/jbd_bms.py,sha256=eWXbKIgWEDlj18TWho5Q2K3YfLyhCJVJOgC6tc5VfxU,7166
19
- aiobmsble/bms/jikong_bms.py,sha256=vl5XQx5-ksYMUaopHdd8Pzw_Rw88zF_0I8m23TPD6BE,11152
20
- aiobmsble/bms/neey_bms.py,sha256=DsIqt2MP9E6lJACw0wDlkx0gMyIPpCwMvIGLz36Otbc,7665
21
- aiobmsble/bms/ogt_bms.py,sha256=t1mxa0l2umlH7p3AKSHclieqQGHRYtgt_iFMVQ7ry8U,7987
22
- aiobmsble/bms/pro_bms.py,sha256=PwP6OeXOj6W3Svu80LOgvqnFaUSdGIm6uTO5If2VhKk,5078
23
- aiobmsble/bms/redodo_bms.py,sha256=EVFWurOvkCuHplHjn7NTqaY-0TmbRBUtFDjrBXqvUcM,4369
24
- aiobmsble/bms/renogy_bms.py,sha256=Pju6kZea0G1uGNONcxQymJ_TW6rk02ovGgIn1-dE_68,5079
25
- aiobmsble/bms/renogy_pro_bms.py,sha256=PO7Q0NaPAf9vzU24PvVubxk7k64L241rQESrk26ul4c,3968
26
- aiobmsble/bms/roypow_bms.py,sha256=l9oJvTPcvS54DDjgeu8Wn74nvwYaEbaK5F4JHGAt_RE,6168
27
- aiobmsble/bms/seplos_bms.py,sha256=mgNcYy1E9KMyE-J8jk8mxF2RZ1D3AZtMYNePVq3d0bs,9517
28
- aiobmsble/bms/seplos_v2_bms.py,sha256=nmzOLHqcaxDnZBCb1i_E1qdF7NN8K10-FAGnnIfjtjA,7493
29
- aiobmsble/bms/tdt_bms.py,sha256=9mFrjmkNo6YY_7klfvJi1_qq8J53o_Ivep9bPO2El3A,7032
30
- aiobmsble/bms/tianpwr_bms.py,sha256=U_du6TzYj_SXZ_f_DHVYVCDhku5hwWWdkkITtJJLNX8,4946
31
- aiobmsble-0.2.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
32
- aiobmsble-0.2.3.dist-info/METADATA,sha256=uT1jajia9dsgQWZzlbuNmBr-N1zS8AoL_VLEKUNBhZg,4711
33
- aiobmsble-0.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
34
- aiobmsble-0.2.3.dist-info/entry_points.txt,sha256=HSC_C3nQikc3nk0a6mcG92RuIM7wAzozjBVfDojJceo,54
35
- aiobmsble-0.2.3.dist-info/top_level.txt,sha256=YHBVzg45mJ3vPz0sl_TpMB0edMqqhD61kwJj4EPAk9g,10
36
- aiobmsble-0.2.3.dist-info/RECORD,,