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
« prev ^ index » next coverage.py v7.11.0, created at 2025-10-30 00:10 +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):
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