TheWeirdDev / Bluetooth_Headset_Battery_Level

A python script to get battery level from Bluetooth headsets
GNU General Public License v3.0
760 stars 83 forks source link

Add documentation on how to contribute new devices #49

Closed liquidat closed 3 years ago

liquidat commented 3 years ago

I'd like to add a new device. But I am not sure what steps to take.

Please provide a document how to add new devices!

TheWeirdDev commented 3 years ago

I don't understand what 'add' means in this context. You can't add your device to the code. You need to find the MAC address of your device and then pass it as an argument to the script.

There are instructions on how to find the mac address and how to run the script in the Readme.md file.

liquidat commented 3 years ago

Sorry, I should have been more specific: I meant how to add code so that more devices are supported out of the box. Like #15 or #41 . Though I am not sure if it is even possible to provide generic documentation since the devices can be so different.

TheWeirdDev commented 3 years ago

You're right. There is no generic way of adding support for a new device.

The only thing you can do is research and trial and error. This script uses AT commands to communicate with the device. So you need to find out if your device supports this commands or not. If it does, which command is responsible for asking the battery info and which command is the response.

For more info about capturing your device's Bluetooth traffic, read this.

liquidat commented 3 years ago

Understood, thanks!