Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make BleakGATTService, BleakGATTCharacteristic, BleakGATTClient platform agnostic #1021

Open
dlech opened this issue Sep 22, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@dlech
Copy link
Collaborator

dlech commented Sep 22, 2022

Currently, there is a backend-specific implementation for BleakGATTService, BleakGATTCharacteristic and BleakGATTClient. However, these should only contain static data, so all data can be passed into the constructor instead of overriding properties. The obj property is the only platform-dependent property an can be typed as typing.Any.

These types can then be moved out of the backends module (as suggested in #904 (comment)).

The non-public methods like get_descriptor and add_descriptor should be made private (by adding an underscore prefix) when we do this.

Also, new properties should be added (as suggested in #759 (comment)) to navigate back up the tree. For example, the descriptor class should have a characteristic property to get the parent characteristic and the service class should have a client property to get the BleakClient. When this is done, we can deprecate the properties like service_uuid since we will be able to write service.uuid instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant