dont cascade pl errors
This commit is contained in:
parent
e1c6759e85
commit
01dc8ab679
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2256,7 +2256,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tesla-charge-controller"
|
||||
version = "0.1.20-prerelease"
|
||||
version = "0.1.20"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"chrono",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "tesla-charge-controller"
|
||||
version = "0.1.20-prerelease"
|
||||
version = "0.1.20"
|
||||
edition = "2021"
|
||||
license = "MITNFA"
|
||||
description = "Controls Tesla charge rate based on solar charge data"
|
||||
|
|
|
@ -217,9 +217,9 @@ impl Pli {
|
|||
T: Into<u8>,
|
||||
{
|
||||
self.send_command(command(20, address.into(), 0));
|
||||
let buf: [u8; 2] = self.receive()?;
|
||||
let buf: [u8; 1] = self.receive()?;
|
||||
if buf[0] == 200 {
|
||||
Ok(buf[1])
|
||||
Ok(self.receive::<1>()?[0])
|
||||
} else {
|
||||
Err(PliError::ReadError(buf[0]))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue