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

6 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-10-30 00:10 +0000

1"""Battery 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 BatteryService(BaseGattService): 

12 """Battery Service implementation. 

13 

14 Contains characteristics related to battery information: 

15 - Battery Level - Required 

16 - Battery Level Status - Optional 

17 """ 

18 

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

20 CharacteristicName.BATTERY_LEVEL: True, # required 

21 CharacteristicName.BATTERY_LEVEL_STATUS: False, # optional 

22 }