Usage Guideline + Authentication
This section walks through SDK conventions and module-by-module authentication patterns. Each subsection covers a single SDK area with the imports it needs, the connection it expects, and the full set of operations available.
If you only need to get started, see Getting Started. If you need a deeper look at connection setup (multiple devices, refresh, disable), see Managing Connections. To use any of these from the shell instead of Python, see Litmus CLI Reference.
In This Section
- Air gap Features - building deployment templates without internet access on the target
- DeviceHub - devices and tags
- DeviceHub Drivers - drivers, bundled templates, JSON-schema validation
- Digital Twins - models, instances, attributes, transformations
- Flows Manager - Node-RED flow lifecycle
- Analytics - processors, instances, AI/ML models, variables
- Integrations - cloud connector instances, topics, subscriptions, object storage
- Marketplace - container images, registries, running containers
- OPC - OPC UA server hierarchy, security, users
- System - users, tokens, network, certificates, events, templates, services
- Litmus Edge Manager (LEM) - multi-device deployments, applications, alerts, certificates, AI models, MPC
SDK Conventions
A few patterns recur across every module:
Default Connection
Most functions accept an optional le_connection (LE-side) or connection (LEM-side) keyword argument. If omitted, the SDK loads a cached default connection from environment variables on first call. See Managing Connections for the env vars and connection modes.
Pydantic Models vs Raw JSON
Functions that fetch data return Pydantic models by default (e.g. Device, Tag, Driver). Pass raw=True to skip validation and get the API JSON unchanged:
parsed = devices.list_devices() # list[Device]
raw = devices.list_devices(raw=True) # list[dict[str, Any]]raw=True is useful when:
- The API schema drifts ahead of your installed SDK version (you don't want validation failures).
- You only need a few fields and don't want the model overhead.
- You're piping JSON to another system.
Coverage of raw=True varies by function. Check signatures in your IDE or via litmus-sdk-cli list <module>.
Version Gating
Functions that exist only on Litmus Edge 4.0.x raise UnsupportedVersionError when called against a 3.x device. The exception names the feature and the minimum required version, so you can branch on it.
Async (LEM only)
Some long-running LEM task functions accept async_=True to return an asyncio.Task[bool] instead of blocking.