Coverage for src / bluetooth_sig / gatt / characteristics / longitude.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"""Longitude characteristic implementation."""
3from __future__ import annotations
5from .base import BaseCharacteristic
6from .templates import ScaledSint32Template
9class LongitudeCharacteristic(BaseCharacteristic[float]):
10 """Longitude characteristic (0x2AAF).
12 org.bluetooth.characteristic.longitude
14 Longitude 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 [-180, 180] degrees.
22 min_value = -180.0
23 max_value = 180.0
24 expected_type = float
26 _template = ScaledSint32Template(scale_factor=DEGREE_SCALING_FACTOR)