How-To Guides¶
Step-by-step instructions for common tasks.
These guides assume you've read the Getting Started section and are familiar with the basic concepts.
-
Telemetry Device
Build a sensor-polling device with optional publish strategies.
-
Command & Control Device
Build a device that receives commands via MQTT.
-
Configuration
Extend Settings, use
.envfiles, override via CLI. -
Hardware Adapters
Register adapters: direct, lazy import, dry-run swapping.
-
Share State Between Handlers
Use adapters-as-state to share data between command and telemetry handlers.
-
Lifespan
Run startup and shutdown code with the lifespan context manager.
-
Multi-Device Registration
Register multiple similar devices from settings with
@app.on_configureand dict-name decorators. -
Testing
Use
cosalette.testing, AppHarness, and pytest fixtures. -
Custom Error Types
Map domain exceptions to structured error payloads.
-
Deployment
Containerise and deploy with Docker, Compose, and Ansible.
-
Build a Full App
Capstone guide — combines everything above into a complete application.