From e914f2fd10c72f1e7b02cbdc8111f7e800912d31 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Thu, 9 Jan 2025 15:53:17 +1100 Subject: [PATCH] v1.9.9-pre-20: fix modbus device id --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- charge-controller-supervisor/src/tristar.rs | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 36e69e9..06f0650 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -239,7 +239,7 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "charge-controller-supervisor" -version = "1.9.9-pre-19" +version = "1.9.9-pre-20" dependencies = [ "chrono", "clap", @@ -2203,7 +2203,7 @@ dependencies = [ [[package]] name = "tesla-charge-controller" -version = "1.9.9-pre-19" +version = "1.9.9-pre-20" dependencies = [ "chrono", "clap", diff --git a/Cargo.toml b/Cargo.toml index 0b3cc21..fca7975 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["charge-controller-supervisor"] resolver = "2" [workspace.package] -version = "1.9.9-pre-19" +version = "1.9.9-pre-20" [workspace.lints.clippy] pedantic = "warn" diff --git a/charge-controller-supervisor/src/tristar.rs b/charge-controller-supervisor/src/tristar.rs index e0bce38..a3da0eb 100644 --- a/charge-controller-supervisor/src/tristar.rs +++ b/charge-controller-supervisor/src/tristar.rs @@ -293,7 +293,8 @@ impl Tristar { tokio_modbus::client::rtu::attach_slave(modbus_serial, slave) } crate::config::Transport::Tcp { ip, port } => { - tokio_modbus::client::tcp::connect((*ip, *port).into()).await? + let modbus_tcp = tokio::net::TcpStream::connect((*ip, *port)).await?; + tokio_modbus::client::tcp::attach_slave(modbus_tcp, slave) } };