cremalink.parsing.monitor.model module

This module defines the high-level data model for a “monitor” data snapshot.

class cremalink.parsing.monitor.model.MonitorSnapshot(raw: bytes, raw_b64: str, received_at: datetime, parsed: dict[str, ~typing.Any]=<factory>, warnings: list[str] = <factory>, errors: list[str] = <factory>, source: str = 'local', device_id: str | None = None, frame: MonitorFrame | None = None)[source]

Bases: object

Represents a single snapshot of the device’s monitoring status.

This dataclass acts as a container for all information related to a single monitor update from the device. It holds the raw data, timestamps, any parsed values, and metadata about the decoding process.

raw

The raw bytes of the monitor data payload.

Type:

bytes

raw_b64

The base64-encoded string representation of the raw data.

Type:

str

received_at

The timestamp when this snapshot was received.

Type:

datetime.datetime

parsed

A dictionary to hold the successfully parsed key-value data.

Type:

dict[str, Any]

warnings

A list of any warnings generated during parsing.

Type:

list[str]

errors

A list of any errors encountered during parsing.

Type:

list[str]

source

The origin of the data (e.g., ‘local’ or ‘cloud’).

Type:

str

device_id

The identifier of the device that sent the data.

Type:

str | None

frame

A MonitorFrame instance if the raw bytes were successfully decoded into a low-level frame structure.

Type:

cremalink.parsing.monitor.frame.MonitorFrame | None

device_id: str | None = None
errors: list[str]
frame: MonitorFrame | None = None
parsed: dict[str, Any]
raw: bytes
raw_b64: str
received_at: datetime
source: str = 'local'
warnings: list[str]