Coverage for src / bluetooth_sig / gatt / characteristics / percentage_8.py: 100%
5 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-03-18 11:17 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-03-18 11:17 +0000
1"""Percentage 8 characteristic (0x2B04)."""
3from __future__ import annotations
5from .base import BaseCharacteristic
6from .templates import ScaledUint8Template
9class Percentage8Characteristic(BaseCharacteristic[float]):
10 """Percentage 8 characteristic (0x2B04).
12 org.bluetooth.characteristic.percentage_8
14 Percentage with a resolution of 0.5.
15 M=1, d=0, b=-1 → scale factor 0.5 (binary exponent 2^-1).
16 Range: 0-100%. A value of 0xFF represents 'value is not known'.
18 Raises:
19 SpecialValueDetectedError: If raw value is a sentinel (e.g. 0xFF).
20 """
22 _template = ScaledUint8Template(scale_factor=0.5)