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
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-11 20:14 +0000
1"""Latitude characteristic implementation."""
3from __future__ import annotations
5from .base import BaseCharacteristic
6from .templates import ScaledSint32Template
9class LatitudeCharacteristic(BaseCharacteristic[float]):
10 """Latitude characteristic (0x2AAE).
12 org.bluetooth.characteristic.latitude
14 Latitude characteristic representing geographic coordinate in degrees.
15 Encoded as sint32 with scale factor 1e-7 degrees per unit.
16 """
18 # Geographic coordinate constants
19 DEGREE_SCALING_FACTOR = 1e-7 # 10^-7 degrees per unit
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
26 _template = ScaledSint32Template(scale_factor=DEGREE_SCALING_FACTOR)