Coverage for src/bluetooth_sig/gatt/characteristics/track_changed.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.14.3, created at 2026-06-28 01:26 +0000

1"""Track Changed characteristic (0x2B96).""" 

2 

3from __future__ import annotations 

4 

5from ..context import CharacteristicContext 

6from .base import BaseCharacteristic 

7 

8 

9class TrackChangedCharacteristic(BaseCharacteristic[bool]): 

10 """Track Changed characteristic (0x2B96). 

11 

12 org.bluetooth.characteristic.track_changed 

13 

14 Notification-only characteristic. Presence of a notification 

15 indicates the current track has changed. 

16 """ 

17 

18 expected_length: int = 0 

19 

20 def _decode_value( 

21 self, data: bytearray, ctx: CharacteristicContext | None = None, *, validate: bool = True 

22 ) -> bool: 

23 return True 

24 

25 def _encode_value(self, data: bool) -> bytearray: 

26 return bytearray()