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

5 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-03-18 11:17 +0000

1"""Humidity 8 characteristic (0x2B23).""" 

2 

3from __future__ import annotations 

4 

5from .base import BaseCharacteristic 

6from .templates import ScaledUint8Template 

7 

8 

9class Humidity8Characteristic(BaseCharacteristic[float]): 

10 """Humidity 8 characteristic (0x2B23). 

11 

12 org.bluetooth.characteristic.humidity_8 

13 

14 Humidity as a 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'. 

17 

18 Raises: 

19 SpecialValueDetectedError: If raw value is a sentinel (e.g. 0xFF). 

20 """ 

21 

22 _template = ScaledUint8Template(scale_factor=0.5)