You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+9-22Lines changed: 9 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,13 @@
3
3
## Issues
4
4
In case you have troubles, please [enable the debug protocol](https://www.home-assistant.io/docs/configuration/troubleshooting/#debug-logs-and-diagnostics) for the [integration](https://my.home-assistant.io/redirect/integration/?domain=bms_ble) and [open an issue](https://github.com/patman15/BMS_BLE-HA/issues) with a good description of what happened and attach the log **as a file**.
5
5
6
-
## Architecture Guidelines
7
-
- The integration shall not use persistent information. That means all necessary info shall be determined on connecting the device.
8
-
- The BT pattern matcher shall be unique to allow auto-detecting devices.
9
-
- Frame parsing shall check the validity of a frame according to the protocol type, e.g. CRC, length, allowed type
10
-
- All plugin classes shall inherit from `BaseBMS` and use the functions from there before overriding or replacing.
11
-
- If available the data shall be read from the device, the `BaseBMS._add_missing_values()` functionality is only to have consistent data over all BMS types.
6
+
## Adding a new battery management system
12
7
13
-
to be extended ...
8
+
The handling of the BMS types is done by the external library [aiobmsble](https://github.com/patman15/aiobmsble). To add a new type, please see the [CONTRIBUTING](https://github.com/patman15/aiobmsble?tab=contributing-ov-file) guidelines of this repository.
9
+
10
+
### Any contributions you make will be under the Apache-2.0 License
11
+
12
+
In short, when you submit code changes, your submissions are understood to be under the same [Apache-2.0](LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern.
14
13
15
14
## Coding Style Guidelines
16
15
@@ -19,22 +18,10 @@ In general I use guidelines very close to the ones that Home Assistant uses for
19
18
-`ruff check .`
20
19
-`mypy .`
21
20
22
-
## Adding a new battery management system
23
-
24
-
1. Fork the repository and create a branch with the name of the new BMS to add.
25
-
2. Add a new file to the `plugins` folder called, e.g. `my_bms.py`
26
-
3. Populate the file with class called `BMS` derived from `BaseBMS`(see basebms.py). A dummy implementation without the actual functionality to query the BMS can befound below in section _Dummy BMS Example_
27
-
4. Make sure that the dictionary returned by `async_update()` has (all) keys listed in `SENSOR_TYPES` (see `sensor.py`), __except__ for `ATTR_LQ` and `ATTR_RSSI` which are automatically handled. To make it simple, just follow the `ATTR_*` import in the example code below.
28
-
5. In `const.py` add the filename (without extention), e.g. `my_bms`, to the constant `BMS_TYPES`.
29
-
6. Add an appropriate [bluetooth device matcher](https://developers.home-assistant.io/docs/creating_integration_manifest#bluetooth) to `manifest.json`. Note that this is required to match the implementation of `match_dict_list()` in the new BMS class.
30
-
7. Test and commit the changes to the branch and create a pull request to the main repository.
31
-
32
21
> [!NOTE]
33
22
> In order to keep maintainability of this integration, pull requests are required to pass standard Home Assistant checks for integrations, [coding style guidelines](#coding-style-guidelines), Python linting, and 100% [branch test coverage](https://coverage.readthedocs.io/en/latest/branch.html#branch).
34
23
35
-
### Any contributions you make will be under the Apache-2.0 License
36
-
37
-
In short, when you submit code changes, your submissions are understood to be under the same [Apache-2.0](LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern.
24
+
## Architecture Guidelines
25
+
- The integration shall not use persistent information. That means all necessary info shall be determined on connecting the device.
38
26
39
-
### Dummy BMS Example
40
-
Note: In order for the [example](custom_components/bms_ble/plugins/dummy_bms.py) to work, you need to set the UUIDs of the service, the characteristic providing notifications, and the characteristic for sending commands to. While the device must be in Bluetooth range, the actual communication does not matter. Always the fixed values in the code will be shown.
Copy file name to clipboardExpand all lines: README.md
+1-4Lines changed: 1 addition & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ This integration allows to monitor Bluetooth Low Energy (BLE) battery management
30
30
- Any number of batteries in parallel
31
31
- Native Home Assistant integration (works with all [HA installation methods](https://www.home-assistant.io/installation/#advanced-installation-methods))
32
32
- Readout of individual cell voltages to be able to judge battery health
33
-
- 100% test coverage plus fuzz tests for BLE data
33
+
- 100% test coverage
34
34
35
35
### Supported Devices
36
36
- ABC/SOK BMS (show up as `ABC-`…, `SOK-`…)
@@ -69,9 +69,6 @@ This integration allows to monitor Bluetooth Low Energy (BLE) battery management
69
69
- Wattcycle batteries
70
70
- TianPower BMS (show up as `TP_`…)
71
71
72
-
> [!TIP]
73
-
> New device types can be easily added via the plugin architecture of this integration. See the [contribution guidelines](CONTRIBUTING.md) for details.
74
-
75
72
### Provided Information
76
73
> [!CAUTION]
77
74
> This integration (including Home Assistant) **shall not be used for safety relevant operations**! The correctness or availability of data cannot be guaranteed (see [warranty section of the license](LICENSE)),
0 commit comments