dreadnought / python-daly-bms

Python module for Daly BMS devices
MIT License
82 stars 37 forks source link

Not an issue - how to use bluetooth script #19

Closed icenov closed 2 years ago

icenov commented 2 years ago

I can see that the cli code calls in the python modules, but how can I use the python bluetooth module on its own? When I run the code it runs without error, but that is expected as it is creating the Class etc. How do I actually connect with BT and call the functions?

dreadnought commented 2 years ago

Here you can see an example of a daemon that uses the Bluetooth module and sends the data to InfluxDB: https://github.com/dreadnought/energy-storage-controller/blob/master/smart_bms.py

The Bluetooth library uses asyncio, so the code using it has to be aware of that and wait for the results results.