Coverage for src / bluetooth_sig / gatt / services / current_time_service.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-11 20:14 +0000

1"""Current Time Service implementation.""" 

2 

3from __future__ import annotations 

4 

5from typing import ClassVar 

6 

7from ..characteristics.registry import CharacteristicName 

8from .base import BaseGattService 

9 

10 

11class CurrentTimeService(BaseGattService): 

12 """Current Time Service implementation. 

13 

14 Exposes the current date and time with additional information. 

15 

16 Contains characteristics related to time: 

17 - Current Time - Required 

18 - Local Time Information - Optional 

19 - Reference Time Information - Optional 

20 """ 

21 

22 service_characteristics: ClassVar[dict[CharacteristicName, bool]] = { 

23 CharacteristicName.CURRENT_TIME: True, # required 

24 CharacteristicName.LOCAL_TIME_INFORMATION: False, # optional 

25 CharacteristicName.REFERENCE_TIME_INFORMATION: False, # optional 

26 }