Compare commits

..

No commits in common. "e614c2a753c0629b636e7780131cec31fa096782" and "502790823e2b2517407842334931c75638eba04e" have entirely different histories.

4 changed files with 14 additions and 21 deletions

View file

@ -7,7 +7,7 @@ edition = "2021"
[dependencies] [dependencies]
anyhow = { version = "1.0.75", features = ["backtrace"] } anyhow = { version = "1.0.75", features = ["backtrace"] }
if-addrs = "0.10.2" if-addrs = "0.10.1"
rand = "0.8.5" rand = "0.8.5"
chrono = "0.4.31" chrono = "0.4.31"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }

View file

@ -474,7 +474,6 @@ mod test {
use super::Cloud; use super::Cloud;
#[tokio::test] #[tokio::test]
#[serial]
async fn reroute() -> Result<()> { async fn reroute() -> Result<()> {
let mut cloud = Cloud::new("michaelh.95@t-online.de", "Hoda.semi1")?; let mut cloud = Cloud::new("michaelh.95@t-online.de", "Hoda.semi1")?;
@ -484,7 +483,6 @@ mod test {
} }
#[tokio::test] #[tokio::test]
#[serial]
async fn login_id() -> Result<()> { async fn login_id() -> Result<()> {
let mut cloud = Cloud::new("michaelh.95@t-online.de", "Hoda.semi1")?; let mut cloud = Cloud::new("michaelh.95@t-online.de", "Hoda.semi1")?;

View file

@ -5,7 +5,6 @@ pub trait RequestSerializer {
fn serialize(&self) -> Vec<u8>; fn serialize(&self) -> Vec<u8>;
} }
#[derive(Clone)]
pub struct CommandRequest { pub struct CommandRequest {
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
pub name: &'static str, pub name: &'static str,

View file

@ -124,8 +124,7 @@ impl Device {
} }
for cmd in cmds { for cmd in cmds {
'sending: loop { self.build_send(cmd)?;
self.build_send(cmd.clone())?;
loop { loop {
let mut buf = [0; 512]; let mut buf = [0; 512];
@ -135,16 +134,15 @@ impl Device {
}; };
if bytes_read == 0 { if bytes_read == 0 {
break; bail!("socket error");
} }
match self.parse_message(&buf[..bytes_read])? { match self.parse_message(&buf[..bytes_read])? {
ParseMessage::Success => break 'sending, ParseMessage::Success => break,
ParseMessage::Padding => continue, ParseMessage::Padding => continue,
} }
} }
} }
}
Ok(()) Ok(())
} }
@ -254,7 +252,6 @@ mod test {
use crate::{device::Device, devices::AttributeValue, Cloud, Startup}; use crate::{device::Device, devices::AttributeValue, Cloud, Startup};
#[tokio::test] #[tokio::test]
#[serial]
async fn verify_hex() -> Result<()> { async fn verify_hex() -> Result<()> {
let devices = Startup::discover().await?; let devices = Startup::discover().await?;
@ -275,7 +272,6 @@ mod test {
} }
#[tokio::test] #[tokio::test]
#[serial]
async fn connect_py_token() -> Result<()> { async fn connect_py_token() -> Result<()> {
let devices = Startup::discover().await?; let devices = Startup::discover().await?;