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

8 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-03-18 11:17 +0000

1"""Elevation characteristic implementation.""" 

2 

3from __future__ import annotations 

4 

5from ...types.units import LengthUnit 

6from .base import BaseCharacteristic 

7from .templates import ScaledSint24Template 

8 

9 

10class ElevationCharacteristic(BaseCharacteristic[float]): 

11 """Elevation characteristic (0x2A6C). 

12 

13 org.bluetooth.characteristic.elevation 

14 

15 Elevation characteristic. 

16 

17 Represents the elevation relative to sea level unless otherwise 

18 specified in the service. 

19 

20 Format: sint24 (3 bytes) with 0.01 meter resolution. 

21 """ 

22 

23 _template = ScaledSint24Template(scale_factor=0.01) 

24 

25 _manual_unit: str | None = LengthUnit.METERS.value # Override template's "units" default 

26 resolution: float = 0.01