chore(home-assistant): implement the revised light protocol
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user