Skip to content

Commit

Permalink
Version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dreadnought committed May 14, 2021
1 parent 879733d commit 8d9d82e
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
dist/
dalybms.egg-info/
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package-build:
python3 setup.py sdist bdist_wheel
twine check dist/*
package-upload:
twine upload dist/*
44 changes: 33 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
# python-daly-bms

This is a Python module for reading data from Daly BMS devices. It supports serial as well as Bluetooth connections. Not all commands that the BMS supports are implemented yet, please take a look at the examples below to see if it serves your needs.

## Installation

### From PyPI

```
pip3 install dalybms
```

### From Git

```
git clone https://github.com/dreadnought/python-daly-bms.git
cd python-daly-bms
sudo python3 setup.py install
```

### Dependencies

For *serial* connections:
```
pip3 install pyserial
```

For *bluetooth* connections:
```
pip3 install bleak
```

## CLI

`./daly-bms-cli.py` is a reference implementation for this module, but can also be used to test the connection or use it in combination with other programming languages. The data gets returned in JSON format. It doesn't support Bluetooth connections yet.
`daly-bms-cli` is a reference implementation for this module, but can also be used to test the connection or use it in combination with other programming languages. The data gets returned in JSON format. It doesn't support Bluetooth connections yet.

### Usage
```
# ./daly-bms-cli.py --help
# daly-bms-cli --help
usage: daly-bms-cli.py [-h] -d DEVICE [--status] [--soc] [--mosfet]
[--cell-voltages] [--temperatures] [--balancing]
[--errors] [--all] [--check] [--retry RETRY]
Expand All @@ -35,7 +61,7 @@ optional arguments:

Get the State of Charge:
```
# ./daly-bms-cli.py -d /dev/ttyUSB0 --soc
# daly-bms-cli -d /dev/ttyUSB0 --soc
{
"total_voltage": 57.7,
"current": -11.1,
Expand All @@ -45,7 +71,7 @@ Get the State of Charge:

Get everything possible:
```
# ./daly-bms-cli.py -d /dev/ttyUSB0 --all
# daly-bms-cli -d /dev/ttyUSB0 --all
{
"soc": {
"total_voltage": 52.5,
Expand Down Expand Up @@ -113,11 +139,7 @@ Get everything possible:

### Bluetooth

- Of Bluetooth connections you need to have `bleak` installed. It's also recommended to have a recent BlueZ installed (>=5.53).

```
pip3 install bleak
```
- It's also recommended to have a recent BlueZ installed (>=5.53).

The Bluetooth connection uses `asyncio` for the connection, so the data is received asynchronous.

Expand Down
File renamed without changes.
26 changes: 26 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import pathlib
from setuptools import setup

HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text()

setup(
name="dalybms",
version="0.1.0",
description="Client for Daly BMS",
long_description=README,
long_description_content_type="text/markdown",
url="https://github.com/dreadnought/python-daly-bms",
author="Patrick Salecker",
author_email="[email protected]",
license="MIT",
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
packages=["dalybms"],
scripts=["bin/daly-bms-cli"],
)

0 comments on commit 8d9d82e

Please sign in to comment.