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

5 statements  

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

1"""High Temperature characteristic (0x2A45).""" 

2 

3from __future__ import annotations 

4 

5from .base import BaseCharacteristic 

6from .templates import ScaledSint16Template 

7 

8 

9class HighTemperatureCharacteristic(BaseCharacteristic[float]): 

10 """High Temperature characteristic (0x2A45). 

11 

12 org.bluetooth.characteristic.high_temperature 

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 A value of 0x8001 represents 'value is not valid'. 

17 

18 Raises: 

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

20 """ 

21 

22 _template = ScaledSint16Template(scale_factor=0.5)