diff --git a/satrs-core/src/power.rs b/satrs-core/src/power.rs index 08f737a..513b479 100644 --- a/satrs-core/src/power.rs +++ b/satrs-core/src/power.rs @@ -47,10 +47,10 @@ pub trait PowerSwitcher { } /// Retrieve the switch state - fn get_switch_state(&mut self, switch_id: SwitchId) -> SwitchState; + fn get_switch_state(&mut self, switch_id: SwitchId) -> Result; - fn get_is_switch_on(&mut self, switch_id: SwitchId) -> bool { - self.get_switch_state(switch_id) == SwitchState::On + fn get_is_switch_on(&mut self, switch_id: SwitchId) -> Result { + Ok(self.get_switch_state(switch_id)? == SwitchState::On) } /// The maximum delay it will take to change a switch.