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

10 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-03 16:41 +0000

1"""Live Health Observations characteristic (0x2B8B). 

2 

3Variable-length ACOM observation format (IEEE 11073-10101). 

4 

5References: 

6 Bluetooth SIG Generic Health Sensor Service specification 

7""" 

8 

9from __future__ import annotations 

10 

11from ..context import CharacteristicContext 

12from .base import BaseCharacteristic 

13 

14 

15class LiveHealthObservationsCharacteristic(BaseCharacteristic[bytes]): 

16 """Live Health Observations characteristic (0x2B8B). 

17 

18 org.bluetooth.characteristic.live_health_observations 

19 

20 Variable-length health observation data using the ACOM 

21 (Abstract Content Object Model) encoding based on 

22 IEEE 11073-10101 nomenclature. 

23 """ 

24 

25 min_length = 1 

26 allow_variable_length = True 

27 

28 def _decode_value( 

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

30 ) -> bytes: 

31 return bytes(data) 

32 

33 def _encode_value(self, data: bytes) -> bytearray: 

34 return bytearray(data)