Coverage for src/bluetooth_sig/gatt/characteristics/cookware_sensor_aggregate.py: 100%
12 statements
« prev ^ index » next coverage.py v7.14.3, created at 2026-06-28 01:26 +0000
« prev ^ index » next coverage.py v7.14.3, created at 2026-06-28 01:26 +0000
1"""Cookware Sensor Aggregate characteristic (0x2C2D)."""
3from __future__ import annotations
5import msgspec
7from ..context import CharacteristicContext
8from .base import BaseCharacteristic
11class CookwareSensorAggregateValue(msgspec.Struct, frozen=True, kw_only=True):
12 """Decoded Cookware Sensor Aggregate payload.
14 CWS defines this value as the concatenation of participating Cookware
15 Sensor Data characteristic values. Segment boundaries are described by the
16 Cooking Sensor Info descriptor Aggregate Offset fields.
17 """
19 aggregate_data: bytes = b""
22class CookwareSensorAggregateCharacteristic(BaseCharacteristic[CookwareSensorAggregateValue]):
23 """Cookware Sensor Aggregate characteristic (0x2C2D).
25 org.bluetooth.characteristic.cookware_sensor_aggregate
26 """
28 allow_variable_length = True
30 def _decode_value(
31 self, data: bytearray, ctx: CharacteristicContext | None = None, *, validate: bool = True
32 ) -> CookwareSensorAggregateValue:
33 return CookwareSensorAggregateValue(aggregate_data=bytes(data))
35 def _encode_value(self, data: CookwareSensorAggregateValue) -> bytearray:
36 return bytearray(data.aggregate_data)