airtouch5
A rust library for communicating with AirTouch 5 air conditioning system control consoles.
Status
This library is a work in progress, and should not be considered stable or ready for production use.
Basic usage
Add this to your Cargo.toml:
[]
= "0.2.0"
and use the airtouch5 crate (or one of its members):
use airtouch5;
use AirTouch5;
use discovery;
The AirTouch5 struct is the primary interface to connect to a console. See
the full documentation for more information.
Discovery
The airtouch5::dicovery
module provides functions to discover an AirTouch 5 console on the local network.
Current status
The AirTouch5 struct provides functions to query the current state of the
AirTouch 5 console and the air conditioning units it controls, as well as to
subscribe to channels that broadcast changes to the current state.
Take control
If the optional control feature is enabled, the AirTouch5 struct gains
control_ac() and control_zone() functions to request state changes of
the AirTouch 5 console, including turning air conditioning units or zones on or
off, or adjusting target temperatures.
[!CAUTION] This feature is disabled by default, because misuse could have significant consequences. For instance, turning a system on inappropriately could run up large energy bills, or turning a system off inappropriately could lead to medical complications such as heatstroke! Use this feature with caution.
Examples
Discover an AirTouch 5 console on the local network:
use AirTouch5;
use discover;
let console = cached_console.unwrap_or;
println!;
let at5 = with_ipaddr;
List the different zones and whether they are active:
// query the zones names and status
let names = at5.zone_names.await?;
let status = at5.zone_status.await?;
// find the longest zone name
let w = names.by_index.map.max.unwrap_or;
let UNNAMED_ZONE = "<unknown>".to_string;
for in status.zones
And print the full zone state again whenever the current state changes:
// subscribe to the current status
let mut watch = at5.subscribe_status?;
loop
With the control Cargo feature, turn the first air conditioning unit on with
automatic fan speed control:
[]
= { = "0.2.0", = ["control"] }
use
at5.control_ac
.await?;
Cargo features
The airtouch5 crate defines the following Cargo features:
control: Enable functions that request state changes. Disabled by default.timeout: Enable_timeoutversions of several functions that return an error if a response is not received in a given period. Enabled by default.
Disclaimer
AirTouch is a registered trade mark of Polyaire Pty Ltd. This library is provided for educational and interoperability purposes.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.