pub fn new(
        on: bool,
        handle_on: Option<&'a mut StateChangeHander>,
        handle_off: Option<&'a mut StateChangeHander>,
        minimum_on: Option<Duration>,
        minimum_off: Option<Duration>,
        now: &'a CurrentTimeMilliseconds,
    ) -> Self {
        let last_changed = now();

        let on_off = Self {
            bang_bang: OnOff::new(on, handle_on, handle_off),
            minimum_on,
            minimum_off,
            last_changed,
            now,
        };

        #[cfg(feature = "log")]
        debug!("instiantiated {:?}", &on_off);

        on_off
    }
/// creates a new on/off controller with optional notification handlers for each state transition
creates a new on/off controller with optional notification handlers for each state transition
creates a new on / off controller with optional notification handlers for each state transition
pub fn new(
        on: bool,
        handle_on: Option<&'a mut StateChangeHander>,
        handle_off: Option<&'a mut StateChangeHander>,
        minimum_on: Option<Duration>,
        minimum_off: Option<Duration>,
        now: &'a CurrentTimeMilliseconds,
    ) -> Self {
        let last_changed = now();
        let on_off = Self {
            bang_bang: OnOff::new(on, handle_on, handle_off),
            minimum_on,
            minimum_off,
            last_changed,
            now,
        };
        #[cfg(feature = "log")]
        debug!("instiantiated {:?}", &on_off);
        on_off
    }
pub fn new ( on : bool , handle_on : Option < & ' a mut StateChangeHander > , handle_off : Option < & ' a mut StateChangeHander > , minimum_on : Option < Duration > , minimum_off : Option < Duration > , now : & ' a CurrentTimeMilliseconds , ) -> Self { let last_changed = now ( ) ; let on_off = Self { bang_bang : OnOff :: new ( on , handle_on , handle_off ) , minimum_on , minimum_off , last_changed , now , } ; # [ cfg ( feature " " ) ] debug ! ( " " on_off ) ; on_off }
creates a new on/off controller with optional notification handlers for each state transition
creates a new on / off controller with optional notification handlers for each state transition
on
bool
handle_on
Option<&'a mut StateChangeHander>
handle_off
Option<&'a mut StateChangeHander>
minimum_on
Option<Duration>
minimum_off
Option<Duration>
now
&'a CurrentTimeMilliseconds
on
bool
handle_on
Option<&'a mut StateChangeHander>
handle_off
Option<&'a mut StateChangeHander>
minimum_on
Option<Duration>
minimum_off
Option<Duration>
now
&'a CurrentTimeMilliseconds