Crates.io | danfoss-ally-rs |
lib.rs | danfoss-ally-rs |
version | 0.0.3 |
source | src |
created_at | 2022-12-12 07:59:29.242463 |
updated_at | 2022-12-12 12:21:13.739011 |
description | A simple rust library to interact with the danfoss ally api |
homepage | |
repository | https://github.com/bgaechter/danfoss-ally-rs |
max_upload_size | |
id | 734824 |
size | 21,481 |
Very basic rust native library to interact with the Danfoss Ally API.
Create a Danfoss Developer. Follow the instructions on the website to create the credentials for the Danfoss Ally API.
Then, Provide your Danfoss API credentials as environment variables.
export DANFOSS_API_KEY=YOUR_API_KEY
export DANFOSS_API_SECRET=YOUR_API_SECRET
After that you are all set and can query the API
#[cfg(not(target_arch = "wasm32"))]
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
env_logger::init();
info! {"Starting up"};
let mut danfoss_api: API = API::new();
danfoss_api.get_token().await?;
danfoss_api.get_devices().await?;
danfoss_api.print_room_temperatures();
Ok(())
}
#[cfg(target_arch = "wasm32")]
fn main() {}
You need to set the logging level to debug in order to print room temperatures.
RUST_LOG=debug cargo run
This is not an official library and i am not affiliated with Danfoss in any way.