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