pub enum ControlSpec {
Setpoint {
setpoint: f32,
hysteresis: f32,
cooling: bool,
safe_band: f32,
},
Level {
empty: f32,
warn_within: u32,
},
Surge {
rising: bool,
limit: f32,
},
Monitor,
}Expand description
How a profile turns each reading into control output and alerts.
This is the policy half of a profile’s manifest: the tunable rule a community can
publish and share, with no code to write. Profile::controller assembles it
into a live Controller. In a manifest it is tagged by kind:
{ "kind": "setpoint", "setpoint": 5.0, "hysteresis": 0.5, "cooling": true, "safe_band": 3.0 }Variants§
Setpoint
Hold a reading near setpoint by switching an output on and off.
Fields
hysteresis: f32Half the deadband width around the setpoint, which stops the output chattering at the threshold.
cooling: boolWhether the output cools (switches on above the band) or heats (switches on below it). An irrigation valve that adds water is a “heater”.
safe_band: f32How far the reading may stray from the setpoint before an
Alert::OutOfRange fires.
Level
Watch a falling level and warn before it reaches empty.
Fields
Surge
Warn when a reading changes faster than limit per sample.
Fields
Monitor
Report readings only, with no control output and no alerts.
Trait Implementations§
Source§impl Clone for ControlSpec
impl Clone for ControlSpec
Source§fn clone(&self) -> ControlSpec
fn clone(&self) -> ControlSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ControlSpec
Source§impl Debug for ControlSpec
impl Debug for ControlSpec
Source§impl<'de> Deserialize<'de> for ControlSpec
impl<'de> Deserialize<'de> for ControlSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ControlSpec
impl PartialEq for ControlSpec
Source§fn eq(&self, other: &ControlSpec) -> bool
fn eq(&self, other: &ControlSpec) -> bool
self and other values to be equal, and is used by ==.