iot_firmware.communications.schema
Module with the schemas related with the communications package.
Classes
|
Message for external communications. |
|
Semantic Versioning following https://semver.org. |
- class iot_firmware.communications.schema.Version(major: int, minor: int, patch: int)[source]
Semantic Versioning following https://semver.org.
- Parameters
major – incompatible API changes
minor – new functionality (backwards compatible)
patch – bug fixes (backwards compatible)
Usage:
>>> ver = Version(major=1, minor=2, patch=3) >>> ver 1.2.3
- major: int
- minor: int
- patch: int
- class iot_firmware.communications.schema.Message(type: str, data: Any, id: int, timestamp: float, api_version: Version, msg_id: int)[source]
Message for external communications.
Basic usage.
>>> message = Message.load({"type": MessageType.READING, "data": {"temp": 24.3}}) >>> message.api_version 0.0.1 >>> message.data {'temp': 24.3}
- type: str
- data: Any
- id: int
- timestamp: float
- msg_id: int