cremalink.parsing.properties package
This package handles the parsing and decoding of device ‘properties’.
Properties are key-value pairs that represent the static or semi-static attributes of the coffee machine, such as configuration settings or counters.
- class cremalink.parsing.properties.PropertiesSnapshot(raw: dict[str, ~typing.Any], received_at: ~datetime.datetime | None, parsed: dict[str, ~typing.Any] = <factory>)[source]
Bases:
objectA container for a snapshot of device properties at a specific time.
This class holds the raw property data as received from the device, the timestamp of when it was received, and a dictionary for any parsed or processed values. It provides a helper method to easily access property values from the potentially nested raw data structure.
- received_at
The timestamp when the snapshot was taken.
- Type:
datetime.datetime | None
- get(name: str) Any[source]
Safely retrieves a property by its name from the raw data.
The properties data can come in different formats. This method checks for the property name as a direct key and also searches within the nested ‘property’ objects that are common in the API response.
- Parameters:
name – The name of the property to retrieve.
- Returns:
The property dictionary if found, otherwise None.