Skip to content

Commit

Permalink
Add characteristics initial values
Browse files Browse the repository at this point in the history
Sets default values for characteristics if not specified explicitly
  • Loading branch information
wpiet committed Dec 4, 2024
1 parent 6168f87 commit 2552e21
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions bumble/profiles/gmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ class GamingAudioService(TemplateService):
UUID = GATT_GAMING_AUDIO_SERVICE

gmap_role: Characteristic
ugg_features: Optional[Characteristic]
ugt_features: Optional[Characteristic]
bgs_features: Optional[Characteristic]
bgr_features: Optional[Characteristic]
ugg_features: Optional[Characteristic] = None
ugt_features: Optional[Characteristic] = None
bgs_features: Optional[Characteristic] = None
bgr_features: Optional[Characteristic] = None

def __init__(
self,
Expand All @@ -93,6 +93,11 @@ def __init__(
) -> None:
characteristics = []

ugg_features = UggFeatures(0) if ugg_features is None else ugg_features
ugt_features = UgtFeatures(0) if ugt_features is None else ugt_features
bgs_features = BgsFeatures(0) if bgs_features is None else bgs_features
bgr_features = BgrFeatures(0) if bgr_features is None else bgr_features

self.gmap_role = Characteristic(
uuid=GATT_GMAP_ROLE_CHARACTERISTIC,
properties=Characteristic.Properties.READ,
Expand Down

0 comments on commit 2552e21

Please sign in to comment.