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.
GreeClient
is a low-level APIGree
is 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
key
field 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_device
is 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
- Asynchronous Gree cilents (requires
tokio
) - Synchronous Gree cilents
- Constants and definitions for Gree parameters and enumerations for their possible values
Macros
- Constructs NetVarBag of SimpleNetVars, for reading (from keys) or writing (from key => value pairs)
Structs
- Information about a gree Device on the network.
- Low-level Gree client configuration
- Gree network configuration
- State of Gree network
- A basic implementation of NetVar
Enums
- NetVar Operation
- Represents any valid JSON value.
Traits
- Network Variable (NetVar) defines a protocol for exchanging Values with the network.
Functions
- Constructs NetVarBag from an iterator of names. The bag returned is ready to be used in a network read call.
- Constructs NetVarBag from an iterator of (name, value) pairs. The bag returned is ready to be used in a network write call.
- Converts NetVarBag into a json. Convenient for value reporting.
Type Definitions
- A collection of network variables by internalized name