Struct follow_heating::io::controls::heating_impl::GPIOHeatingControl
source · pub struct GPIOHeatingControl<G: GPIOManager> {
gpio_manager: G,
pins: GPIOPins,
should_sleep: bool,
valve_start_open_time: Duration,
valve_change_time: Duration,
pump_water_slow_time: Duration,
extra_heat_pump_water_slow_time: Duration,
heat_pump_last_changed: DateTime<Utc>,
}
Fields§
§gpio_manager: G
§pins: GPIOPins
§should_sleep: bool
§valve_start_open_time: Duration
§valve_change_time: Duration
§pump_water_slow_time: Duration
§extra_heat_pump_water_slow_time: Duration
§heat_pump_last_changed: DateTime<Utc>
Implementations§
source§impl<G: GPIOManager> GPIOHeatingControl<G>
impl<G: GPIOManager> GPIOHeatingControl<G>
pub fn create( pins: GPIOPins, gpio_manager: G, control_config: &ControlConfig ) -> Result<Self, GPIOError>
fn get_valve_pin(&self, valve: &Valve) -> usize
fn get_pump_pin(&self, pump: &Pump) -> usize
fn set_valve(&mut self, valve: &Valve, open: bool) -> Result<(), BrainFailure>
fn get_valve(&self, valve: &Valve) -> Result<bool, BrainFailure>
fn set_pump(&mut self, pump: &Pump, on: bool) -> Result<(), BrainFailure>
fn get_pump(&self, pump: &Pump) -> Result<bool, BrainFailure>
fn wait_for(&self, amount: Duration, why: &str)
fn switch_to_configuration( &mut self, config: &ValveAndPumpConfiguration ) -> Result<(), BrainFailure>
sourcefn update_pumps_if_needed(
&mut self,
config: &ValveAndPumpConfiguration,
to: bool
) -> Result<bool, BrainFailure>
fn update_pumps_if_needed( &mut self, config: &ValveAndPumpConfiguration, to: bool ) -> Result<bool, BrainFailure>
Change pumps’ state to the given state if they are not already in that state. To turn on pumps that need turning on, call with to: true To turn off pumps that need turning off, call with to: false
sourcefn update_valves_if_needed(
&mut self,
config: &ValveAndPumpConfiguration,
to: bool
) -> Result<bool, BrainFailure>
fn update_valves_if_needed( &mut self, config: &ValveAndPumpConfiguration, to: bool ) -> Result<bool, BrainFailure>
Change valves’ state to the given state if they are not already in that state. To open valves that need opening, call with to: true To turn off pumps that need closing, call with to: false
sourcefn change_valve_if_needed(
&mut self,
valve: &Valve,
open: bool
) -> Result<bool, BrainFailure>
fn change_valve_if_needed( &mut self, valve: &Valve, open: bool ) -> Result<bool, BrainFailure>
Change the valve to the given state if needed. Returns whether the valve was changed.
sourcefn change_pump_if_needed(
&mut self,
pump: &Pump,
open: bool
) -> Result<bool, BrainFailure>
fn change_pump_if_needed( &mut self, pump: &Pump, open: bool ) -> Result<bool, BrainFailure>
Change the pump to the given state if needed. Returns whether the pump was changed.
Trait Implementations§
source§impl<G: GPIOManager> HeatCirculationPumpControl for GPIOHeatingControl<G>
impl<G: GPIOManager> HeatCirculationPumpControl for GPIOHeatingControl<G>
fn try_set_heat_circulation_pump( &mut self, on: bool ) -> Result<(), BrainFailure>
fn try_get_heat_circulation_pump(&self) -> Result<bool, BrainFailure>
fn set_heat_circulation_pump( &mut self, on: bool, debug_message: Option<&'static str> ) -> Result<(), BrainFailure>
source§impl<G: GPIOManager> HeatPumpControl for GPIOHeatingControl<G>
impl<G: GPIOManager> HeatPumpControl for GPIOHeatingControl<G>
fn try_set_heat_pump(&mut self, mode: HeatPumpMode) -> Result<(), BrainFailure>
fn try_get_heat_pump(&self) -> Result<HeatPumpMode, BrainFailure>
fn get_heat_pump_on_with_time(&self) -> Result<(bool, Duration), BrainFailure>
fn set_heat_pump( &mut self, mode: HeatPumpMode, debug_message: Option<&'static str> ) -> Result<(), BrainFailure>
source§impl<G: GPIOManager + 'static> HeatingControl for GPIOHeatingControl<G>
impl<G: GPIOManager + 'static> HeatingControl for GPIOHeatingControl<G>
fn as_hp(&mut self) -> &mut dyn HeatPumpControl
fn as_cp(&mut self) -> &mut dyn HeatCirculationPumpControl
Auto Trait Implementations§
impl<G> RefUnwindSafe for GPIOHeatingControl<G>where
G: RefUnwindSafe,
impl<G> Send for GPIOHeatingControl<G>
impl<G> Sync for GPIOHeatingControl<G>where
G: Sync,
impl<G> Unpin for GPIOHeatingControl<G>where
G: Unpin,
impl<G> UnwindSafe for GPIOHeatingControl<G>where
G: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more