Coverage for src / bluetooth_sig / gatt / characteristics / rainfall.py: 100%
8 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-11 20:14 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-11 20:14 +0000
1"""Rainfall characteristic implementation."""
3from __future__ import annotations
5from ...types.units import LengthUnit
6from .base import BaseCharacteristic
7from .templates import ScaledUint16Template
10class RainfallCharacteristic(BaseCharacteristic[float]):
11 """Rainfall characteristic (0x2A78).
13 org.bluetooth.characteristic.rainfall
15 Rainfall characteristic.
17 Represents the amount of rain that has fallen in millimeters. Uses
18 uint16 with 1 mm resolution (1:1 scaling).
19 """
21 _template = ScaledUint16Template(scale_factor=1.0) # 1mm resolution
23 _manual_unit: str = LengthUnit.MILLIMETERS.value # Override template's "units" default
24 resolution: float = 1.0 # 1mm resolution