move things around

Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
This commit is contained in:
Frank Villaro-Dixon 2024-03-04 20:42:46 +01:00
parent 12efb33cf2
commit db0036a2bc
6 changed files with 25 additions and 31 deletions

8
Cargo.lock generated
View file

@ -156,14 +156,6 @@ version = "0.4.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
[[package]]
name = "mytest"
version = "0.1.0"
dependencies = [
"daikin_altherma",
"thiserror",
]
[[package]] [[package]]
name = "percent-encoding" name = "percent-encoding"
version = "2.3.1" version = "2.3.1"

View file

@ -1,4 +1,3 @@
workspace = { members = ["mytest"] }
[package] [package]
name = "daikin_altherma" name = "daikin_altherma"
version = "0.0.1" version = "0.0.1"
@ -25,3 +24,6 @@ url = "2.5.0"
[dependencies.uuid] [dependencies.uuid]
version = "1.7.0" version = "1.7.0"
features = ["v4"] features = ["v4"]
[package.metadata.docs.rs]
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]

View file

@ -1,14 +1,6 @@
use daikin_altherma::DaikinAlthermaClient; use daikin_altherma::DaikinAlthermaClient;
fn main() { fn main() {
let mut a = DaikinAlthermaClient::new("192.168.11.100".to_string()).unwrap(); let mut a = DaikinAlthermaClient::new("192.168.11.100".to_string()).unwrap();
// let am = a.get_adapter_model();
// println!("Adapter model: {am}");
//
//a.set_holiday_mode(false);
//# let hm = a.is_holiday_mode();
//# println!("Holiday mode: {hm}");
let tp = a.get_tank_parameters().unwrap(); let tp = a.get_tank_parameters().unwrap();
println!("Tank: {:?}", tp); println!("Tank: {:?}", tp);

10
examples/temperature.rs Normal file
View file

@ -0,0 +1,10 @@
use daikin_altherma::DaikinAlthermaClient;
fn main() {
let mut a = DaikinAlthermaClient::new("192.168.11.100".to_string()).unwrap();
let hp = a.get_heating_parameters().unwrap();
println!("Heating: {:?}", hp);
a.set_heating_setpoint_temperature(20.0);
let hp = a.get_heating_parameters().unwrap();
println!("Heating: {:?}", hp);
}

View file

@ -1,10 +0,0 @@
[package]
name = "mytest"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
daikin_altherma = {path = "/home/frank/src/github.com/frankkkkk/daikin-altherma-rs/"}
thiserror = "1.0.57"

View file

@ -1,4 +1,12 @@
use std::{fmt::Debug, net::TcpStream}; //! # API to Daikin Altherma LAN Adapters
//!
//! This rust crate interfaces with Daikin Altherma LAN adapters.
//! There are two firmware versions of the LAN adapters:
//! - Cloud connected
//! - LAN only
//! This library only supports the second one for the moment.
use std::net::TcpStream;
use uuid::Uuid; use uuid::Uuid;
use serde_json::{json, Value}; use serde_json::{json, Value};
@ -8,9 +16,9 @@ use url::Url;
mod errors; mod errors;
mod params; mod params;
mod traits; mod traits;
use crate::errors::DAError; pub use crate::errors::DAError;
use crate::params::HeatingParameters; pub use crate::params::HeatingParameters;
use crate::params::TankParameters; pub use crate::params::TankParameters;
pub struct DaikinAlthermaClient { pub struct DaikinAlthermaClient {
ws_client: WebSocket<stream::MaybeTlsStream<TcpStream>>, ws_client: WebSocket<stream::MaybeTlsStream<TcpStream>>,