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

10 statements  

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

1"""Time Change Log Data characteristic (0x2B92). 

2 

3Variable-length time change records. 

4 

5References: 

6 Bluetooth SIG Device Time Service specification 

7""" 

8 

9from __future__ import annotations 

10 

11from ..context import CharacteristicContext 

12from .base import BaseCharacteristic 

13 

14 

15class TimeChangeLogDataCharacteristic(BaseCharacteristic[bytes]): 

16 """Time Change Log Data characteristic (0x2B92). 

17 

18 org.bluetooth.characteristic.time_change_log_data 

19 

20 Variable-length records documenting time changes on the device. 

21 """ 

22 

23 min_length = 1 

24 allow_variable_length = True 

25 

26 def _decode_value( 

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

28 ) -> bytes: 

29 return bytes(data) 

30 

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

32 return bytearray(data)