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

5 statements  

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

1"""Temperature 8 characteristic (0x2B0D).""" 

2 

3from __future__ import annotations 

4 

5from .base import BaseCharacteristic 

6from .templates import ScaledSint8Template 

7 

8 

9class Temperature8Characteristic(BaseCharacteristic[float]): 

10 """Temperature 8 characteristic (0x2B0D). 

11 

12 org.bluetooth.characteristic.temperature_8 

13 

14 Temperature in degrees Celsius with a resolution of 0.5. 

15 M=1, d=0, b=-1 → scale factor 0.5 (binary exponent 2^-1). 

16 Range: -64.0 to 63.0. A value of 0x7F represents 'value is not known'. 

17 

18 Raises: 

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

20 """ 

21 

22 _template = ScaledSint8Template(scale_factor=0.5)