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

9 statements  

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

1"""Voltage Frequency characteristic implementation.""" 

2 

3from __future__ import annotations 

4 

5from ...types.units import ElectricalUnit 

6from .base import BaseCharacteristic 

7from .templates import Uint16Template 

8 

9 

10class VoltageFrequencyCharacteristic(BaseCharacteristic[int]): 

11 """Voltage Frequency characteristic (0x2BE8). 

12 

13 org.bluetooth.characteristic.voltage_frequency 

14 

15 Voltage Frequency characteristic. 

16 

17 Measures voltage frequency with resolution of 1 Hz (M=1, d=0, b=0). 

18 """ 

19 

20 _template = Uint16Template() 

21 

22 _manual_unit: str = ElectricalUnit.HERTZ.value # Override template's "units" default 

23 resolution: float = 1.0 

24 max_value: int = 65533 # Exclude special values 0xFFFE and 0xFFFF