aiobmsble 0.4__py3-none-any.whl → 0.4.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.
@@ -5,7 +5,6 @@ import json
5
5
  from typing import Any
6
6
 
7
7
  from bleak.backends.scanner import AdvertisementData
8
- import pytest
9
8
 
10
9
  from tests.bluetooth import generate_advertisement_data
11
10
 
@@ -29,11 +28,15 @@ def _json_dict_to_advdata(json_dict: dict[str, Any]) -> AdvertisementData:
29
28
  return generate_advertisement_data(**json_dict)
30
29
 
31
30
 
32
- @pytest.fixture
33
31
  def bms_advertisements() -> BmsAdvList:
34
32
  """Provide all available BMS advertisements from test data directory.
35
33
 
36
34
  Load all *_bms.json files from the packaged test data directory.
35
+
36
+ Returns:
37
+ BmsAdvList: List of tuples containing advertisement, bms type,
38
+ and a list of comments, i.e. list[tuple[AdvertisementData, str, list[str]]]
39
+
37
40
  """
38
41
  all_data: BmsAdvList = []
39
42
 
@@ -62,11 +65,15 @@ def bms_advertisements() -> BmsAdvList:
62
65
  return all_data
63
66
 
64
67
 
65
- @pytest.fixture
66
68
  def ignore_advertisements() -> BmsAdvList:
67
69
  """Provide a list of advertisements that shall not be identified as a valid BMS.
68
70
 
69
71
  Load ignore.json files from the packaged test data directory.
72
+
73
+ Returns:
74
+ BmsAdvList: List of tuples containing advertisement, reason why not to detect,
75
+ and a list of comments, i.e. list[tuple[AdvertisementData, str, list[str]]]
76
+
70
77
  """
71
78
  data: BmsAdvList = []
72
79
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiobmsble
3
- Version: 0.4
3
+ Version: 0.4.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
@@ -114,16 +114,14 @@ if __name__ == "__main__":
114
114
  ```
115
115
 
116
116
  ### Testing
117
- For integrations tests (using pytest) the library provides advertisement data that can be used to verify detection of BMSs. To use it, include the following line into your `conftest.py`:
118
- ```python
119
- pytest_plugins: list[str] = ["aiobmsble.test_data"]
120
- ```
117
+ For integrations tests (using pytest) the library provides advertisement data that can be used to verify detection of BMSs. For your tests you can use
121
118
 
122
- For your tests you can then use
123
119
  ```python
124
- def test_advertisements(bms_advertisements) -> None:
120
+ from aiobmsble.test_data import bms_advertisements
121
+
122
+ def test_advertisements() -> None:
125
123
  """Run some tests with the advertisements"""
126
- for advertisement, bms_type, _comments in bms_advertisements:
124
+ for advertisement, bms_type, _comments in bms_advertisements():
127
125
  ...
128
126
  ```
129
127
 
@@ -29,7 +29,7 @@ aiobmsble/bms/seplos_bms.py,sha256=R4A77uwjy5XDbbPNwzfqOZxaQfIvGs-Vnd-0Ch0zw-s,9
29
29
  aiobmsble/bms/seplos_v2_bms.py,sha256=un6vvMwWXnFzAUgOnHYg69Jokd9MH-9MjqELOQD6Uok,7494
30
30
  aiobmsble/bms/tdt_bms.py,sha256=ksGPwTAcn4WDrjSh8a0OzokDhWqrOcixLU3XfndfPyI,7033
31
31
  aiobmsble/bms/tianpwr_bms.py,sha256=2EdaCnY4_PxfRUUrU1hQgwvst5fHDz6yvGS7FU_zYxs,4947
32
- aiobmsble/test_data/__init__.py,sha256=lWBwiwUuGZk9pwBmpWHRzSbmVi4ZbXgRVltoxcLfyg4,3339
32
+ aiobmsble/test_data/__init__.py,sha256=Iik1zKomyHwrBp2VL9USkSBSrlVjcz3djgSZa_dnrsI,3649
33
33
  aiobmsble/test_data/abc_bms.json,sha256=xSKro1Aechkgod-mWo_azkgcMW55dZhSxxy2OoTsH94,875
34
34
  aiobmsble/test_data/ant_bms.json,sha256=NjcRYC7UALV5Bj2vkCMkOf-5KhoywOO64gjze0WTyn4,373
35
35
  aiobmsble/test_data/ant_leg_bms.json,sha256=HKTkLaovPDqFaGrwgtOxqUEe7LZGJn9O2uEaWDY6CcQ,375
@@ -56,9 +56,9 @@ aiobmsble/test_data/seplos_bms.json,sha256=i1FFOL0ytINZU-98wk9L2DrY9AhvvgvkO54xd
56
56
  aiobmsble/test_data/seplos_v2_bms.json,sha256=W7l6yDiZDt62zoiA1oNfVZ9NMMpC-c1wwCUUvVHtet0,901
57
57
  aiobmsble/test_data/tdt_bms.json,sha256=lLyO_-RCZ6nPbGkkShk--uXMyUXHxFx6mVzuc9swtf0,196
58
58
  aiobmsble/test_data/tianpwr_bms.json,sha256=9FHUqTaJQKB74T8A1noWjfcHBXI5LffZ8pUawkLbRGc,239
59
- aiobmsble-0.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
60
- aiobmsble-0.4.dist-info/METADATA,sha256=IzkoRCKPTjp1IxmVIyJPoMNdTBqEmb7RoM3uBO2QH_o,6586
61
- aiobmsble-0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
62
- aiobmsble-0.4.dist-info/entry_points.txt,sha256=HSC_C3nQikc3nk0a6mcG92RuIM7wAzozjBVfDojJceo,54
63
- aiobmsble-0.4.dist-info/top_level.txt,sha256=YHBVzg45mJ3vPz0sl_TpMB0edMqqhD61kwJj4EPAk9g,10
64
- aiobmsble-0.4.dist-info/RECORD,,
59
+ aiobmsble-0.4.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
60
+ aiobmsble-0.4.1.dist-info/METADATA,sha256=27tyBfHOE2UsSdQhGmYato6H9XmyOx4qvuxHayx8JQc,6490
61
+ aiobmsble-0.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
62
+ aiobmsble-0.4.1.dist-info/entry_points.txt,sha256=HSC_C3nQikc3nk0a6mcG92RuIM7wAzozjBVfDojJceo,54
63
+ aiobmsble-0.4.1.dist-info/top_level.txt,sha256=YHBVzg45mJ3vPz0sl_TpMB0edMqqhD61kwJj4EPAk9g,10
64
+ aiobmsble-0.4.1.dist-info/RECORD,,