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

10 statements  

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

1"""Peripheral Privacy Flag characteristic implementation.""" 

2 

3from __future__ import annotations 

4 

5from enum import IntEnum 

6 

7from .base import BaseCharacteristic 

8from .templates import EnumTemplate 

9 

10 

11class PeripheralPrivacyState(IntEnum): 

12 """Peripheral privacy state.""" 

13 

14 DISABLED = 0 

15 ENABLED = 1 

16 

17 

18class PeripheralPrivacyFlagCharacteristic(BaseCharacteristic[PeripheralPrivacyState]): 

19 """Peripheral Privacy Flag characteristic (0x2A02). 

20 

21 org.bluetooth.characteristic.gap.peripheral_privacy_flag 

22 

23 Indicates whether privacy is enabled (1) or disabled (0). 

24 """ 

25 

26 expected_length: int = 1 

27 _template = EnumTemplate.uint8(PeripheralPrivacyState)