chore(home-assistant): implement the revised light protocol

This commit is contained in:
2025-05-03 21:07:08 -04:00
parent 50e9ee43f7
commit 089e96b99f
3 changed files with 70 additions and 84 deletions

View File

@@ -20,3 +20,21 @@ impl<'py> FromPyObject<'py> for LightState {
Ok(state)
}
}
impl From<LightState> for protocol::light::State {
fn from(light_state: LightState) -> Self {
match light_state {
LightState::On => protocol::light::State::On,
LightState::Off => protocol::light::State::Off,
}
}
}
impl From<protocol::light::State> for LightState {
fn from(state: protocol::light::State) -> Self {
match state {
protocol::light::State::On => LightState::On,
protocol::light::State::Off => LightState::Off,
}
}
}