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

9 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-11 20:14 +0000

1"""Latitude characteristic implementation.""" 

2 

3from __future__ import annotations 

4 

5from .base import BaseCharacteristic 

6from .templates import ScaledSint32Template 

7 

8 

9class LatitudeCharacteristic(BaseCharacteristic[float]): 

10 """Latitude characteristic (0x2AAE). 

11 

12 org.bluetooth.characteristic.latitude 

13 

14 Latitude characteristic representing geographic coordinate in degrees. 

15 Encoded as sint32 with scale factor 1e-7 degrees per unit. 

16 """ 

17 

18 # Geographic coordinate constants 

19 DEGREE_SCALING_FACTOR = 1e-7 # 10^-7 degrees per unit 

20 

21 # SIG range not encoded in YAML; enforce spec bounds [-90, 90] degrees. 

22 min_value = -90.0 

23 max_value = 90.0 

24 expected_type = float 

25 

26 _template = ScaledSint32Template(scale_factor=DEGREE_SCALING_FACTOR)