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

16 statements  

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

1"""Data structures used by templates. 

2 

3Frozen msgspec.Struct types for structured template return values. 

4""" 

5 

6from __future__ import annotations 

7 

8from datetime import datetime 

9 

10import msgspec 

11 

12from ....types.gatt_enums import AdjustReason, DayOfWeek 

13 

14 

15class VectorData(msgspec.Struct, frozen=True, kw_only=True): # pylint: disable=too-few-public-methods 

16 """3D vector measurement data.""" 

17 

18 x_axis: float 

19 y_axis: float 

20 z_axis: float 

21 

22 

23class Vector2DData(msgspec.Struct, frozen=True, kw_only=True): # pylint: disable=too-few-public-methods 

24 """2D vector measurement data.""" 

25 

26 x_axis: float 

27 y_axis: float 

28 

29 

30class TimeData(msgspec.Struct, frozen=True, kw_only=True): # pylint: disable=too-few-public-methods 

31 """Time characteristic data structure.""" 

32 

33 date_time: datetime | None 

34 day_of_week: DayOfWeek 

35 fractions256: int 

36 adjust_reason: AdjustReason