Coverage for src / bluetooth_sig / gatt / characteristics / body_sensor_location.py: 100%
16 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"""Body Sensor Location characteristic implementation."""
3from __future__ import annotations
5from enum import IntEnum
7from .base import BaseCharacteristic
8from .templates import EnumTemplate
11class BodySensorLocation(IntEnum):
12 """Body sensor location enumeration (0x2A38)."""
14 OTHER = 0
15 CHEST = 1
16 WRIST = 2
17 FINGER = 3
18 HAND = 4
19 EAR_LOBE = 5
20 FOOT = 6
23class BodySensorLocationCharacteristic(BaseCharacteristic[int]):
24 """Body Sensor Location characteristic (0x2A38).
26 Represents the location of a sensor on the human body.
27 Used primarily with heart rate and other health monitoring devices.
29 Spec: Bluetooth SIG Assigned Numbers, Body Sensor Location characteristic
30 """
32 _template = EnumTemplate.uint8(BodySensorLocation)
34 # YAML has no range constraint; enforce valid enum bounds.
35 min_value: int = BodySensorLocation.OTHER # 0
36 max_value: int = BodySensorLocation.FOOT # 6