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

8 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-10-30 00:10 +0000

1"""Rainfall characteristic implementation.""" 

2 

3from __future__ import annotations 

4 

5from ...types.units import LengthUnit 

6from .base import BaseCharacteristic 

7from .templates import ScaledUint16Template 

8 

9 

10class RainfallCharacteristic(BaseCharacteristic): 

11 """Rainfall characteristic (0x2A78). 

12 

13 org.bluetooth.characteristic.rainfall 

14 

15 Rainfall characteristic. 

16 

17 Represents the amount of rain that has fallen in millimeters. Uses 

18 uint16 with 1 mm resolution (1:1 scaling). 

19 """ 

20 

21 _template = ScaledUint16Template(scale_factor=1.0) # 1mm resolution 

22 

23 _manual_unit: str = LengthUnit.MILLIMETERS.value # Override template's "units" default 

24 resolution: float = 1.0 # 1mm resolution