unittests are working well
Some checks failed
Rust/sat-rs/pipeline/pr-main There was a failure building this commit

This commit is contained in:
2024-03-07 17:11:24 +01:00
parent c9f71125a3
commit 3dd6ad6155
6 changed files with 168 additions and 62 deletions

View File

@ -42,6 +42,15 @@ impl TryFrom<SwitchState> for SwitchStateBinary {
}
}
impl<T: Into<u64>> From<T> for SwitchStateBinary {
fn from(value: T) -> Self {
if value.into() == 0 {
return SwitchStateBinary::Off;
}
SwitchStateBinary::On
}
}
impl From<SwitchStateBinary> for SwitchState {
fn from(value: SwitchStateBinary) -> Self {
match value {