Rustuya 0.4
Control and discover Tuya devices on your local network in pure Rust.
Rustuya provides raw data points (DPS), managed connections and fleet discovery,
with a no_std + alloc protocol core and a Tokio driver.
Current stable version: 0.4.4. Requires Rust 1.89 or later.
[dependencies]
rustuya = { version = "0.4", features = ["tokio"] }
tokio = { version = "1", features = ["full"] }
Start with Getting started for a complete query example. Commands are fire-and-forget: replies and device pushes arrive on a subscribed listener. Connections reconnect with backoff, and discovery can track IP changes.
Choose your version
| Documentation | Use it for |
|---|---|
| 0.4 — this site | The current pure-Rust API: rustuya::tokio, rustuya-tokio, rustuya-core |
| 0.3 archive | The previous Rust async/sync API and Python bindings |
0.4 is a breaking redesign. Python bindings and a blocking/sync driver are not included in 0.4. Existing users of those APIs should use the 0.3 documentation. See Migrating from 0.3 for the API mapping.
Guides
- Getting started — dependencies, device credentials and a first query.
- Rust API guide — commands, events, current state, sub-devices and fleets.
- Discovery — LAN scans, addressless connections and rediscovery.
- Architecture — the core/driver boundary and embedded scope.
- Technical notes — timeouts, backpressure, shutdown and testing.
- Design philosophy — scope and API decisions.
- FAQ — common connection and migration questions.
API reference and source
- rustuya 0.4.4 API — facade with the
tokiofeature. - rustuya-tokio 0.4.4 API — the Tokio driver.
- rustuya-core 0.4.4 API — the sans-I/O core.
- Release notes.
- Source on master, 0.3 source archive.