Expand description
Controlling Gree Smart air conditioning units via Rust
This crate defines two clients, GreeClient and Gree, for each of two programming styles (synchronous and asynchronous).
Asynchronous clients require tokio feature.
GreeClientis a low-level APIGreeis a high-level Gree protocol client. It maintains network state and provides a kind of automated workflow.
See documentation under sync_client and async_client.
§Gree high-level client
In particular, in Gree scans and binds typically do not need to be invoked explicitly, as the client invokes them from
within net_read/net_write/with_device if necessary. More precisely:
- Bind is invoked if the Device’s
keyfield is needed but empty - Scan is invoked if one of the following holds:
- the last scan performed is older than
max_scan_age net_read/net_write/with_deviceis called against a device that is missing from the internal state- there was a network error communicating with the device
- the scan was invoked explicitly
- the last scan performed is older than
- Scan is always bypassed if the last scan performed is younger than
min_scan_age
§Features
tokio- enable asynchronous clients withtokio
§See also
- https://github.com/tomikaa87/gree-remote - Protocol description, API in several languages, CLI in python
Modules§
- async_
client - Asynchronous Gree cilents (requires
tokio) - sync_
client - Synchronous Gree cilents
- vars
- Constants and definitions for Gree parameters and enumerations for their possible values
Macros§
- net_
var_ bag - Constructs NetVarBag of SimpleNetVars, for reading (from keys) or writing (from key => value pairs)
Structs§
- Device
- Information about a gree Device on the network.
- Gree
Client Config - Low-level Gree client configuration
- Gree
Config - Gree network configuration
- Gree
State - State of Gree network
- Simple
NetVar - A basic implementation of NetVar
Enums§
Traits§
- NetVar
- Network Variable (NetVar) defines a protocol for exchanging Values with the network.
Functions§
- net_
var_ bag_ from_ names - Constructs NetVarBag from an iterator of names. The bag returned is ready to be used in a network read call.
- net_
var_ bag_ from_ nvs - Constructs NetVarBag from an iterator of (name, value) pairs. The bag returned is ready to be used in a network write call.
- net_
var_ bag_ to_ json - Converts NetVarBag into a json. Convenient for value reporting.