cremalink.local_server_app.models module
This module defines the Pydantic data models used for API request and response validation in the local server application. These models ensure type safety and clear contracts for the API endpoints.
- class cremalink.local_server_app.models.CommandPollResponse(*, enc: str, sign: str, seq: int)[source]
Bases:
BaseModelModel for the response when polling for a command result from the device. It includes the encrypted response, a signature, and a sequence number.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cremalink.local_server_app.models.CommandRequest(*, command: str)[source]
Bases:
BaseModelModel for the /command endpoint request body.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cremalink.local_server_app.models.ConfigureRequest(*, dsn: str, device_ip: str, lan_key: str, device_scheme: str = 'https', monitor_property_name: str | None = None)[source]
Bases:
BaseModelModel for the /configure endpoint request body. It contains all the necessary information to establish a connection with a local device.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cremalink.local_server_app.models.EncPayload(*, enc: str)[source]
Bases:
BaseModelA generic model for a payload that contains encrypted data (enc).
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cremalink.local_server_app.models.KeyExchange(*, random_1: str, time_1: str | int)[source]
Bases:
BaseModelRepresents the data payload for the key exchange process, which is part of the authentication handshake with the device.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cremalink.local_server_app.models.KeyExchangeRequest(*, key_exchange: KeyExchange)[source]
Bases:
BaseModelModel for a key exchange request, wrapping the KeyExchange payload.
- key_exchange: KeyExchange
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cremalink.local_server_app.models.MonitorResponse(*, monitor: Dict[str, Any] | Any | None = None, monitor_b64: str | None = None, received_at: float | None = None)[source]
Bases:
BaseModelModel for the response from the /get_monitor endpoint. Includes the parsed monitor data, the raw base64 string, and a timestamp.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cremalink.local_server_app.models.PropertiesResponse(*, properties: Dict[str, ~typing.Any]=<factory>, received_at: float | None = None)[source]
Bases:
BaseModelModel for the response from the /get_properties endpoint. Includes the dictionary of properties and a timestamp.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].