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

8 statements  

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

1"""High Voltage characteristic implementation.""" 

2 

3from __future__ import annotations 

4 

5from ...types.units import ElectricalUnit 

6from .base import BaseCharacteristic 

7from .templates import ScaledUint24Template 

8 

9 

10class HighVoltageCharacteristic(BaseCharacteristic[float]): 

11 """High Voltage characteristic (0x2BE0). 

12 

13 org.bluetooth.characteristic.high_voltage 

14 

15 High Voltage characteristic. 

16 

17 Measures high voltage systems using uint24 (3 bytes) format. 

18 """ 

19 

20 _template = ScaledUint24Template(scale_factor=1 / 64) 

21 

22 _manual_unit = ElectricalUnit.VOLTS.value # Override template's "units" default 

23 resolution: float = 1 / 64 # 1/64 V per raw unit (M=1, d=0, b=-6)