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

Create an interface to this ~~script~~ library #66

Closed Galaxy102 closed 2 years ago

Galaxy102 commented 2 years ago

Hey @TheWeirdDev,

thanks for your work, it gave me a great starting point to develop a Budgie Applet (coming soon) to request my new headset's battery state. To integrate it more smoothly, I abstracted the C-ish source code into a (I hope at least) more Pythonic interface. The main difference - besides the abstraction in a class - is that nothing outside the if __name__ == '__main__' can write to stdout and Errors are raised in a programmatic manner.

Please let me know if you request any changes. If you don't want my pseudonym in the source file, I'm open to removing it.

Best regards, Konstantin (@Galaxy102)

TheWeirdDev commented 2 years ago

The code is so nice and clean. I tested it and it works very well. Thanks for spending your time improving this project.

I'm going to merge this, but before that, can you provide some instructions on how to use it as a library for people who might be interested in that?

Galaxy102 commented 2 years ago

Thank you for the nice comment. I added the instructions to the README.