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

8 statements  

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

1"""CO2 Concentration characteristic implementation.""" 

2 

3from __future__ import annotations 

4 

5from .base import BaseCharacteristic 

6from .templates import ConcentrationTemplate 

7 

8 

9class CO2ConcentrationCharacteristic(BaseCharacteristic[float]): 

10 r"""Carbon Dioxide concentration characteristic (0x2B8C). 

11 

12 YAML registry name uses LaTeX subscript form ("CO\\textsubscript{2} Concentration"). 

13 We restore explicit `_characteristic_name` so UUID resolution succeeds because 

14 the automatic CamelCase splitter cannot derive the LaTeX form from the class name. 

15 

16 Represents carbon dioxide concentration in parts per million (ppm) 

17 with a resolution of 1 ppm. 

18 """ 

19 

20 # Explicit YAML/registry name (contains LaTeX markup not derivable heuristically) 

21 _characteristic_name = "CO\\textsubscript{2} Concentration" 

22 

23 _template = ConcentrationTemplate() 

24 

25 _manual_unit: str | None = "ppm" # Override template's "ppm" default 

26 

27 # Template configuration 

28 resolution: float = 1.0