ESPHome 2025.5.0
Loading...
Searching...
No Matches
esphome::sprinkler::Sprinkler Class Reference

#include <sprinkler.h>

Inheritance diagram for esphome::sprinkler::Sprinkler:
esphome::Component

Public Member Functions

 Sprinkler ()
 
 Sprinkler (const std::string &name)
 
void setup () override
 
void loop () override
 
void dump_config () override
 
void add_valve (SprinklerControllerSwitch *valve_sw, SprinklerControllerSwitch *enable_sw=nullptr)
 add a valve to the controller
 
void add_controller (Sprinkler *other_controller)
 add another controller to the controller so it can check if pumps/main valves are in use
 
void set_controller_main_switch (SprinklerControllerSwitch *controller_switch)
 configure important controller switches
 
void set_controller_auto_adv_switch (SprinklerControllerSwitch *auto_adv_switch)
 
void set_controller_queue_enable_switch (SprinklerControllerSwitch *queue_enable_switch)
 
void set_controller_reverse_switch (SprinklerControllerSwitch *reverse_switch)
 
void set_controller_standby_switch (SprinklerControllerSwitch *standby_switch)
 
void set_controller_multiplier_number (SprinklerControllerNumber *multiplier_number)
 configure important controller number components
 
void set_controller_repeat_number (SprinklerControllerNumber *repeat_number)
 
void configure_valve_switch (size_t valve_number, switch_::Switch *valve_switch, uint32_t run_duration)
 configure a valve's switch object and run duration. run_duration is time in seconds.
 
void configure_valve_switch_pulsed (size_t valve_number, switch_::Switch *valve_switch_off, switch_::Switch *valve_switch_on, uint32_t pulse_duration, uint32_t run_duration)
 
void configure_valve_pump_switch (size_t valve_number, switch_::Switch *pump_switch)
 configure a valve's associated pump switch object
 
void configure_valve_pump_switch_pulsed (size_t valve_number, switch_::Switch *pump_switch_off, switch_::Switch *pump_switch_on, uint32_t pulse_duration)
 
void configure_valve_run_duration_number (size_t valve_number, SprinklerControllerNumber *run_duration_number)
 configure a valve's run duration number component
 
void set_divider (optional< uint32_t > divider)
 sets the multiplier value to '1 / divider' and sets repeat value to divider
 
void set_multiplier (optional< float > multiplier)
 value multiplied by configured run times – used to extend or shorten the cycle
 
void set_next_prev_ignore_disabled_valves (bool ignore_disabled)
 enable/disable skipping of disabled valves by the next and previous actions
 
void set_pump_start_delay (uint32_t start_delay)
 set how long the pump should start after the valve (when the pump is starting)
 
void set_pump_stop_delay (uint32_t stop_delay)
 set how long the pump should stop after the valve (when the pump is starting)
 
void set_valve_start_delay (uint32_t start_delay)
 set how long the valve should start after the pump (when the pump is stopping)
 
void set_valve_stop_delay (uint32_t stop_delay)
 set how long the valve should stop after the pump (when the pump is stopping)
 
void set_pump_switch_off_during_valve_open_delay (bool pump_switch_off_during_valve_open_delay)
 if pump_switch_off_during_valve_open_delay is true, the controller will switch off the pump during the valve_open_delay interval
 
void set_valve_open_delay (uint32_t valve_open_delay)
 set how long the controller should wait to open/switch on the valve after it becomes active
 
void set_valve_overlap (uint32_t valve_overlap)
 set how long the controller should wait after opening a valve before closing the previous valve
 
void set_manual_selection_delay (uint32_t manual_selection_delay)
 set how long the controller should wait to activate a valve after next_valve() or previous_valve() is called
 
void set_valve_run_duration (optional< size_t > valve_number, optional< uint32_t > run_duration)
 set how long the valve should remain on/open. run_duration is time in seconds
 
void set_auto_advance (bool auto_advance)
 if auto_advance is true, controller will iterate through all enabled valves
 
void set_repeat (optional< uint32_t > repeat)
 set the number of times to repeat a full cycle
 
void set_queue_enable (bool queue_enable)
 if queue_enable is true, controller will iterate through valves in the queue
 
void set_reverse (bool reverse)
 if reverse is true, controller will iterate through all enabled valves in reverse (descending) order
 
void set_standby (bool standby)
 if standby is true, controller will refuse to activate any valves
 
uint32_t valve_run_duration (size_t valve_number)
 returns valve_number's run duration in seconds
 
uint32_t valve_run_duration_adjusted (size_t valve_number)
 returns valve_number's run duration (in seconds) adjusted by multiplier_
 
bool auto_advance ()
 returns true if auto_advance is enabled
 
float multiplier ()
 returns the current value of the multiplier
 
optional< uint32_t > repeat ()
 returns the number of times the controller is set to repeat cycles, if at all. check with 'has_value()'
 
optional< uint32_t > repeat_count ()
 if a cycle is active, returns the number of times the controller has repeated the cycle. check with 'has_value()'
 
bool queue_enabled ()
 returns true if the queue is enabled to run
 
bool reverse ()
 returns true if reverse is enabled
 
bool standby ()
 returns true if standby is enabled
 
void start_from_queue ()
 starts the controller from the first valve in the queue and disables auto_advance.
 
void start_full_cycle ()
 starts a full cycle of all enabled valves and enables auto_advance.
 
void start_single_valve (optional< size_t > valve_number, optional< uint32_t > run_duration=nullopt)
 activates a single valve and disables auto_advance.
 
void queue_valve (optional< size_t > valve_number, optional< uint32_t > run_duration)
 adds a valve into the queue.
 
void clear_queued_valves ()
 clears/removes all valves from the queue
 
void next_valve ()
 advances to the next valve (numerically)
 
void previous_valve ()
 advances to the previous valve (numerically)
 
void shutdown (bool clear_queue=false)
 turns off all valves, effectively shutting down the system.
 
void pause ()
 same as shutdown(), but also stores active_valve() and time_remaining() allowing resume() to continue the cycle
 
void resume ()
 resumes a cycle that was suspended using pause()
 
void resume_or_start_full_cycle ()
 if a cycle was suspended using pause(), resumes it. otherwise calls start_full_cycle()
 
void reset_resume ()
 resets resume state
 
const char * valve_name (size_t valve_number)
 returns a pointer to a valve's name string object; returns nullptr if valve_number is invalid
 
optional< SprinklerValveRunRequestOriginactive_valve_request_is_from ()
 returns what invoked the valve that is currently active, if any. check with 'has_value()'
 
optional< size_t > active_valve ()
 returns the number of the valve that is currently active, if any. check with 'has_value()'
 
optional< size_t > paused_valve ()
 returns the number of the valve that is paused, if any. check with 'has_value()'
 
optional< size_t > queued_valve ()
 returns the number of the next valve in the queue, if any. check with 'has_value()'
 
optional< size_t > manual_valve ()
 returns the number of the valve that is manually selected, if any.
 
size_t number_of_valves ()
 returns the number of valves the controller is configured with
 
bool is_a_valid_valve (size_t valve_number)
 returns true if valve number is valid
 
bool pump_in_use (SprinklerSwitch *pump_switch)
 returns true if the pump the pointer points to is in use
 
void set_pump_state (SprinklerSwitch *pump_switch, bool state)
 switches on/off a pump "safely" by checking that the new state will not conflict with another controller
 
uint32_t total_cycle_time_all_valves ()
 returns the amount of time in seconds required for all valves
 
uint32_t total_cycle_time_enabled_valves ()
 returns the amount of time in seconds required for all enabled valves
 
uint32_t total_cycle_time_enabled_incomplete_valves ()
 returns the amount of time in seconds required for all enabled & incomplete valves, not including the active valve
 
uint32_t total_queue_time ()
 returns the amount of time in seconds required for all valves in the queue
 
optional< uint32_t > time_remaining_active_valve ()
 returns the amount of time remaining in seconds for the active valve, if any
 
optional< uint32_t > time_remaining_current_operation ()
 returns the amount of time remaining in seconds for all valves remaining, including the active valve, if any
 
bool any_controller_is_active ()
 returns true if this or any sprinkler controller this controller knows about is active
 
SprinklerState controller_state ()
 returns the current state of the sprinkler controller
 
SprinklerControllerSwitchcontrol_switch (size_t valve_number)
 returns a pointer to a valve's control switch object
 
SprinklerControllerSwitchenable_switch (size_t valve_number)
 returns a pointer to a valve's enable switch object
 
SprinklerSwitchvalve_switch (size_t valve_number)
 returns a pointer to a valve's switch object
 
SprinklerSwitchvalve_pump_switch (size_t valve_number)
 returns a pointer to a valve's pump switch object
 
SprinklerSwitchvalve_pump_switch_by_pump_index (size_t pump_index)
 returns a pointer to a valve's pump switch object
 
- Public Member Functions inherited from esphome::Component
virtual float get_setup_priority () const
 priority of setup().
 
float get_actual_setup_priority () const
 
void set_setup_priority (float priority)
 
virtual float get_loop_priority () const
 priority of loop().
 
void call ()
 
virtual void on_shutdown ()
 
virtual void on_safe_shutdown ()
 
uint32_t get_component_state () const
 
virtual void mark_failed ()
 Mark this component as failed.
 
void mark_failed (const char *message)
 
bool is_failed () const
 
bool is_ready () const
 
virtual bool can_proceed ()
 
bool status_has_warning () const
 
bool status_has_error () const
 
void status_set_warning (const char *message="unspecified")
 
void status_set_error (const char *message="unspecified")
 
void status_clear_warning ()
 
void status_clear_error ()
 
void status_momentary_warning (const std::string &name, uint32_t length=5000)
 
void status_momentary_error (const std::string &name, uint32_t length=5000)
 
bool has_overridden_loop () const
 
void set_component_source (const char *source)
 Set where this component was loaded from for some debug messages.
 
const char * get_component_source () const
 Get the integration where this component was declared as a string.
 
bool should_warn_of_blocking (uint32_t blocking_time)
 

Protected Member Functions

bool valve_is_enabled_ (size_t valve_number)
 returns true if valve number is enabled
 
void mark_valve_cycle_complete_ (size_t valve_number)
 marks a valve's cycle as complete
 
bool valve_cycle_complete_ (size_t valve_number)
 returns true if valve's cycle is flagged as complete
 
optional< size_t > next_valve_number_ (optional< size_t > first_valve=nullopt, bool include_disabled=true, bool include_complete=true)
 returns the number of the next valve in the vector or nullopt if no valves match criteria
 
optional< size_t > previous_valve_number_ (optional< size_t > first_valve=nullopt, bool include_disabled=true, bool include_complete=true)
 returns the number of the previous valve in the vector or nullopt if no valves match criteria
 
optional< size_t > next_valve_number_in_cycle_ (optional< size_t > first_valve=nullopt)
 returns the number of the next valve that should be activated in a full cycle.
 
void load_next_valve_run_request_ (optional< size_t > first_valve=nullopt)
 loads next_req_ with the next valve that should be activated, including its run duration.
 
bool any_valve_is_enabled_ ()
 returns true if any valve is enabled
 
void start_valve_ (SprinklerValveRunRequest *req)
 loads an available SprinklerValveOperator (valve_op_) based on req and starts it (switches it on).
 
void all_valves_off_ (bool include_pump=false)
 turns off/closes all valves, including pump if include_pump is true
 
void prep_full_cycle_ ()
 prepares for a full cycle by verifying auto-advance is on as well as one or more valve enable switches.
 
void reset_cycle_states_ ()
 resets the cycle state for all valves
 
void fsm_request_ (size_t requested_valve, uint32_t requested_run_duration=0)
 make a request of the state machine
 
void fsm_kick_ ()
 kicks the state machine to advance, starting it if it is not already active
 
void fsm_transition_ ()
 advance controller state, advancing to target_valve if provided
 
void fsm_transition_from_shutdown_ ()
 starts up the system from IDLE state
 
void fsm_transition_from_valve_run_ ()
 transitions from ACTIVE state to ACTIVE (as in, next valve) or to a SHUTDOWN or IDLE state
 
void fsm_transition_to_shutdown_ ()
 starts up the system from IDLE state
 
std::string req_as_str_ (SprinklerValveRunRequestOrigin origin)
 return the specified SprinklerValveRunRequestOrigin as a string
 
std::string state_as_str_ (SprinklerState state)
 return the specified SprinklerState state as a string
 
void start_timer_ (SprinklerTimerIndex timer_index)
 Start/cancel/get status of valve timers.
 
bool cancel_timer_ (SprinklerTimerIndex timer_index)
 
bool timer_active_ (SprinklerTimerIndex timer_index)
 returns true if the specified timer is active/running
 
void set_timer_duration_ (SprinklerTimerIndex timer_index, uint32_t time)
 time is converted to milliseconds (ms) for set_timeout()
 
uint32_t timer_duration_ (SprinklerTimerIndex timer_index)
 returns time in milliseconds (ms)
 
std::function< void()> timer_cbf_ (SprinklerTimerIndex timer_index)
 
void valve_selection_callback_ ()
 callback functions for timers
 
void sm_timer_callback_ ()
 
- Protected Member Functions inherited from esphome::Component
virtual void call_loop ()
 
virtual void call_setup ()
 
virtual void call_dump_config ()
 
void set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f)
 Set an interval function with a unique name.
 
void set_interval (uint32_t interval, std::function< void()> &&f)
 
bool cancel_interval (const std::string &name)
 Cancel an interval function.
 
void set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f)
 Set an retry function with a unique name.
 
void set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f)
 
bool cancel_retry (const std::string &name)
 Cancel a retry function.
 
void set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a unique name.
 
void set_timeout (uint32_t timeout, std::function< void()> &&f)
 
bool cancel_timeout (const std::string &name)
 Cancel a timeout function.
 
void defer (const std::string &name, std::function< void()> &&f)
 Defer a callback to the next loop() call.
 
void defer (std::function< void()> &&f)
 Defer a callback to the next loop() call.
 
bool cancel_defer (const std::string &name)
 Cancel a defer callback using the specified name, name must not be empty.
 

Protected Attributes

const uint8_t max_queue_size_ {100}
 Maximum allowed queue size.
 
bool next_prev_ignore_disabled_ {false}
 When set to true, the next and previous actions will skip disabled valves.
 
bool pump_switch_off_during_valve_open_delay_ {false}
 Pump should be off during valve_open_delay interval.
 
bool valve_overlap_ {false}
 Sprinkler valve cycle should overlap.
 
bool start_delay_is_valve_delay_ {false}
 Pump start/stop delay interval types.
 
bool stop_delay_is_valve_delay_ {false}
 
uint32_t start_delay_ {0}
 Pump start/stop delay intervals.
 
uint32_t stop_delay_ {0}
 
std::string name_
 
SprinklerState state_ {IDLE}
 Sprinkler controller state.
 
SprinklerValveRunRequest active_req_
 The valve run request that is currently active.
 
SprinklerValveRunRequest next_req_
 The next run request for the controller to consume after active_req_ is complete.
 
SprinklerValveRunRequest prev_req_
 The previous run request the controller processed.
 
optional< size_t > manual_valve_
 The number of the manually selected valve currently selected.
 
optional< size_t > paused_valve_
 The number of the valve to resume from (if paused)
 
optional< uint32_t > target_repeats_
 Set the number of times to repeat a full cycle.
 
optional< uint32_t > resume_duration_
 Set from time_remaining() when paused.
 
optional< uint32_t > manual_selection_delay_
 Manual switching delay.
 
optional< uint32_t > switching_delay_
 Valve switching delay.
 
uint32_t repeat_count_ {0}
 Number of times the full cycle has been repeated.
 
float multiplier_ {1.0}
 Sprinkler valve run time multiplier value.
 
std::vector< SprinklerQueueItemqueued_valves_
 Queue of valves to activate next, regardless of auto-advance.
 
std::vector< SprinklerSwitchpump_
 Sprinkler valve pump objects.
 
std::vector< SprinklerValvevalve_
 Sprinkler valve objects.
 
std::vector< SprinklerValveOperatorvalve_op_ {2}
 Sprinkler valve operator objects.
 
std::vector< SprinklerTimertimer_ {}
 Valve control timers.
 
std::vector< Sprinkler * > other_controllers_
 Other Sprinkler instances we should be aware of (used to check if pumps are in use)
 
SprinklerControllerSwitchauto_adv_sw_ {nullptr}
 Switches we'll present to the front end.
 
SprinklerControllerSwitchcontroller_sw_ {nullptr}
 
SprinklerControllerSwitchqueue_enable_sw_ {nullptr}
 
SprinklerControllerSwitchreverse_sw_ {nullptr}
 
SprinklerControllerSwitchstandby_sw_ {nullptr}
 
SprinklerControllerNumbermultiplier_number_ {nullptr}
 Number components we'll present to the front end.
 
SprinklerControllerNumberrepeat_number_ {nullptr}
 
std::unique_ptr< ShutdownAction<> > sprinkler_shutdown_action_
 
std::unique_ptr< ShutdownAction<> > sprinkler_standby_shutdown_action_
 
std::unique_ptr< ResumeOrStartAction<> > sprinkler_resumeorstart_action_
 
std::unique_ptr< Automation<> > sprinkler_turn_off_automation_
 
std::unique_ptr< Automation<> > sprinkler_turn_on_automation_
 
std::unique_ptr< Automation<> > sprinkler_standby_turn_on_automation_
 
- Protected Attributes inherited from esphome::Component
uint32_t component_state_ {0x0000}
 State of this component.
 
float setup_priority_override_ {NAN}
 
const char * component_source_ {nullptr}
 
uint32_t warn_if_blocking_over_ {WARN_IF_BLOCKING_OVER_MS}
 
std::string error_message_ {}
 

Detailed Description

Definition at line 205 of file sprinkler.h.

Constructor & Destructor Documentation

◆ Sprinkler() [1/2]

esphome::sprinkler::Sprinkler::Sprinkler ( )

Definition at line 393 of file sprinkler.cpp.

◆ Sprinkler() [2/2]

esphome::sprinkler::Sprinkler::Sprinkler ( const std::string & name)

Definition at line 394 of file sprinkler.cpp.

Member Function Documentation

◆ active_valve()

optional< size_t > esphome::sprinkler::Sprinkler::active_valve ( )

returns the number of the valve that is currently active, if any. check with 'has_value()'

Definition at line 1011 of file sprinkler.cpp.

◆ active_valve_request_is_from()

optional< SprinklerValveRunRequestOrigin > esphome::sprinkler::Sprinkler::active_valve_request_is_from ( )

returns what invoked the valve that is currently active, if any. check with 'has_value()'

Definition at line 1004 of file sprinkler.cpp.

◆ add_controller()

void esphome::sprinkler::Sprinkler::add_controller ( Sprinkler * other_controller)

add another controller to the controller so it can check if pumps/main valves are in use

Definition at line 447 of file sprinkler.cpp.

◆ add_valve()

void esphome::sprinkler::Sprinkler::add_valve ( SprinklerControllerSwitch * valve_sw,
SprinklerControllerSwitch * enable_sw = nullptr )

add a valve to the controller

Definition at line 419 of file sprinkler.cpp.

◆ all_valves_off_()

void esphome::sprinkler::Sprinkler::all_valves_off_ ( bool include_pump = false)
protected

turns off/closes all valves, including pump if include_pump is true

Definition at line 1443 of file sprinkler.cpp.

◆ any_controller_is_active()

bool esphome::sprinkler::Sprinkler::any_controller_is_active ( )

returns true if this or any sprinkler controller this controller knows about is active

Definition at line 1236 of file sprinkler.cpp.

◆ any_valve_is_enabled_()

bool esphome::sprinkler::Sprinkler::any_valve_is_enabled_ ( )
protected

returns true if any valve is enabled

Definition at line 1410 of file sprinkler.cpp.

◆ auto_advance()

bool esphome::sprinkler::Sprinkler::auto_advance ( )

returns true if auto_advance is enabled

Definition at line 759 of file sprinkler.cpp.

◆ cancel_timer_()

bool esphome::sprinkler::Sprinkler::cancel_timer_ ( SprinklerTimerIndex timer_index)
protected

Definition at line 1657 of file sprinkler.cpp.

◆ clear_queued_valves()

void esphome::sprinkler::Sprinkler::clear_queued_valves ( )

clears/removes all valves from the queue

Definition at line 888 of file sprinkler.cpp.

◆ configure_valve_pump_switch()

void esphome::sprinkler::Sprinkler::configure_valve_pump_switch ( size_t valve_number,
switch_::Switch * pump_switch )

configure a valve's associated pump switch object

Definition at line 515 of file sprinkler.cpp.

◆ configure_valve_pump_switch_pulsed()

void esphome::sprinkler::Sprinkler::configure_valve_pump_switch_pulsed ( size_t valve_number,
switch_::Switch * pump_switch_off,
switch_::Switch * pump_switch_on,
uint32_t pulse_duration )

Definition at line 529 of file sprinkler.cpp.

◆ configure_valve_run_duration_number()

void esphome::sprinkler::Sprinkler::configure_valve_run_duration_number ( size_t valve_number,
SprinklerControllerNumber * run_duration_number )

configure a valve's run duration number component

Definition at line 547 of file sprinkler.cpp.

◆ configure_valve_switch()

void esphome::sprinkler::Sprinkler::configure_valve_switch ( size_t valve_number,
switch_::Switch * valve_switch,
uint32_t run_duration )

configure a valve's switch object and run duration. run_duration is time in seconds.

Definition at line 497 of file sprinkler.cpp.

◆ configure_valve_switch_pulsed()

void esphome::sprinkler::Sprinkler::configure_valve_switch_pulsed ( size_t valve_number,
switch_::Switch * valve_switch_off,
switch_::Switch * valve_switch_on,
uint32_t pulse_duration,
uint32_t run_duration )

Definition at line 504 of file sprinkler.cpp.

◆ control_switch()

SprinklerControllerSwitch * esphome::sprinkler::Sprinkler::control_switch ( size_t valve_number)

returns a pointer to a valve's control switch object

Definition at line 1251 of file sprinkler.cpp.

◆ controller_state()

SprinklerState esphome::sprinkler::Sprinkler::controller_state ( )
inline

returns the current state of the sprinkler controller

Definition at line 414 of file sprinkler.h.

◆ dump_config()

void esphome::sprinkler::Sprinkler::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 1689 of file sprinkler.cpp.

◆ enable_switch()

SprinklerControllerSwitch * esphome::sprinkler::Sprinkler::enable_switch ( size_t valve_number)

returns a pointer to a valve's enable switch object

Definition at line 1258 of file sprinkler.cpp.

◆ fsm_kick_()

void esphome::sprinkler::Sprinkler::fsm_kick_ ( )
protected

kicks the state machine to advance, starting it if it is not already active

Definition at line 1484 of file sprinkler.cpp.

◆ fsm_request_()

void esphome::sprinkler::Sprinkler::fsm_request_ ( size_t requested_valve,
uint32_t requested_run_duration = 0 )
protected

make a request of the state machine

Definition at line 1476 of file sprinkler.cpp.

◆ fsm_transition_()

void esphome::sprinkler::Sprinkler::fsm_transition_ ( )
protected

advance controller state, advancing to target_valve if provided

Definition at line 1490 of file sprinkler.cpp.

◆ fsm_transition_from_shutdown_()

void esphome::sprinkler::Sprinkler::fsm_transition_from_shutdown_ ( )
protected

starts up the system from IDLE state

Definition at line 1537 of file sprinkler.cpp.

◆ fsm_transition_from_valve_run_()

void esphome::sprinkler::Sprinkler::fsm_transition_from_valve_run_ ( )
protected

transitions from ACTIVE state to ACTIVE (as in, next valve) or to a SHUTDOWN or IDLE state

Definition at line 1554 of file sprinkler.cpp.

◆ fsm_transition_to_shutdown_()

void esphome::sprinkler::Sprinkler::fsm_transition_to_shutdown_ ( )
protected

starts up the system from IDLE state

Definition at line 1601 of file sprinkler.cpp.

◆ is_a_valid_valve()

bool esphome::sprinkler::Sprinkler::is_a_valid_valve ( size_t valve_number)

returns true if valve number is valid

Definition at line 1032 of file sprinkler.cpp.

◆ load_next_valve_run_request_()

void esphome::sprinkler::Sprinkler::load_next_valve_run_request_ ( optional< size_t > first_valve = nullopt)
protected

loads next_req_ with the next valve that should be activated, including its run duration.

if next_req_ already contains a request, nothing is done. after next_req_, queued valves have priority, followed by enabled valves if auto-advance is enabled. if no valve is next (for example, a full cycle is complete), next_req_ is reset via reset().

Definition at line 1364 of file sprinkler.cpp.

◆ loop()

void esphome::sprinkler::Sprinkler::loop ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 404 of file sprinkler.cpp.

◆ manual_valve()

optional< size_t > esphome::sprinkler::Sprinkler::manual_valve ( )

returns the number of the valve that is manually selected, if any.

check with 'has_value()' this is set by next_valve() and previous_valve() when manual_selection_delay_ > 0

Definition at line 1028 of file sprinkler.cpp.

◆ mark_valve_cycle_complete_()

void esphome::sprinkler::Sprinkler::mark_valve_cycle_complete_ ( size_t valve_number)
protected

marks a valve's cycle as complete

Definition at line 1297 of file sprinkler.cpp.

◆ multiplier()

float esphome::sprinkler::Sprinkler::multiplier ( )

returns the current value of the multiplier

Definition at line 766 of file sprinkler.cpp.

◆ next_valve()

void esphome::sprinkler::Sprinkler::next_valve ( )

advances to the next valve (numerically)

Definition at line 893 of file sprinkler.cpp.

◆ next_valve_number_()

optional< size_t > esphome::sprinkler::Sprinkler::next_valve_number_ ( optional< size_t > first_valve = nullopt,
bool include_disabled = true,
bool include_complete = true )
protected

returns the number of the next valve in the vector or nullopt if no valves match criteria

Definition at line 1311 of file sprinkler.cpp.

◆ next_valve_number_in_cycle_()

optional< size_t > esphome::sprinkler::Sprinkler::next_valve_number_in_cycle_ ( optional< size_t > first_valve = nullopt)
protected

returns the number of the next valve that should be activated in a full cycle.

if no valve is next (cycle is complete), returns no value (check with 'has_value()')

Definition at line 1357 of file sprinkler.cpp.

◆ number_of_valves()

size_t esphome::sprinkler::Sprinkler::number_of_valves ( )

returns the number of valves the controller is configured with

Definition at line 1030 of file sprinkler.cpp.

◆ pause()

void esphome::sprinkler::Sprinkler::pause ( )

same as shutdown(), but also stores active_valve() and time_remaining() allowing resume() to continue the cycle

Definition at line 954 of file sprinkler.cpp.

◆ paused_valve()

optional< size_t > esphome::sprinkler::Sprinkler::paused_valve ( )

returns the number of the valve that is paused, if any. check with 'has_value()'

Definition at line 1019 of file sprinkler.cpp.

◆ prep_full_cycle_()

void esphome::sprinkler::Sprinkler::prep_full_cycle_ ( )
protected

prepares for a full cycle by verifying auto-advance is on as well as one or more valve enable switches.

Definition at line 1455 of file sprinkler.cpp.

◆ previous_valve()

void esphome::sprinkler::Sprinkler::previous_valve ( )

advances to the previous valve (numerically)

Definition at line 916 of file sprinkler.cpp.

◆ previous_valve_number_()

optional< size_t > esphome::sprinkler::Sprinkler::previous_valve_number_ ( optional< size_t > first_valve = nullopt,
bool include_disabled = true,
bool include_complete = true )
protected

returns the number of the previous valve in the vector or nullopt if no valves match criteria

Definition at line 1334 of file sprinkler.cpp.

◆ pump_in_use()

bool esphome::sprinkler::Sprinkler::pump_in_use ( SprinklerSwitch * pump_switch)

returns true if the pump the pointer points to is in use

Definition at line 1036 of file sprinkler.cpp.

◆ queue_enabled()

bool esphome::sprinkler::Sprinkler::queue_enabled ( )

returns true if the queue is enabled to run

Definition at line 788 of file sprinkler.cpp.

◆ queue_valve()

void esphome::sprinkler::Sprinkler::queue_valve ( optional< size_t > valve_number,
optional< uint32_t > run_duration )

adds a valve into the queue.

queued valves have priority over valves to be run as a part of a full cycle. NOTE: queued valves will always run, regardless of auto-advance and/or valve enable switches.

Definition at line 877 of file sprinkler.cpp.

◆ queued_valve()

optional< size_t > esphome::sprinkler::Sprinkler::queued_valve ( )

returns the number of the next valve in the queue, if any. check with 'has_value()'

Definition at line 1021 of file sprinkler.cpp.

◆ repeat()

optional< uint32_t > esphome::sprinkler::Sprinkler::repeat ( )

returns the number of times the controller is set to repeat cycles, if at all. check with 'has_value()'

Definition at line 773 of file sprinkler.cpp.

◆ repeat_count()

optional< uint32_t > esphome::sprinkler::Sprinkler::repeat_count ( )

if a cycle is active, returns the number of times the controller has repeated the cycle. check with 'has_value()'

Definition at line 780 of file sprinkler.cpp.

◆ req_as_str_()

std::string esphome::sprinkler::Sprinkler::req_as_str_ ( SprinklerValveRunRequestOrigin origin)
protected

return the specified SprinklerValveRunRequestOrigin as a string

Definition at line 1608 of file sprinkler.cpp.

◆ reset_cycle_states_()

void esphome::sprinkler::Sprinkler::reset_cycle_states_ ( )
protected

resets the cycle state for all valves

Definition at line 1470 of file sprinkler.cpp.

◆ reset_resume()

void esphome::sprinkler::Sprinkler::reset_resume ( )

resets resume state

Definition at line 992 of file sprinkler.cpp.

◆ resume()

void esphome::sprinkler::Sprinkler::resume ( )

resumes a cycle that was suspended using pause()

Definition at line 965 of file sprinkler.cpp.

◆ resume_or_start_full_cycle()

void esphome::sprinkler::Sprinkler::resume_or_start_full_cycle ( )

if a cycle was suspended using pause(), resumes it. otherwise calls start_full_cycle()

Definition at line 984 of file sprinkler.cpp.

◆ reverse()

bool esphome::sprinkler::Sprinkler::reverse ( )

returns true if reverse is enabled

Definition at line 795 of file sprinkler.cpp.

◆ set_auto_advance()

void esphome::sprinkler::Sprinkler::set_auto_advance ( bool auto_advance)

if auto_advance is true, controller will iterate through all enabled valves

Definition at line 661 of file sprinkler.cpp.

◆ set_controller_auto_adv_switch()

void esphome::sprinkler::Sprinkler::set_controller_auto_adv_switch ( SprinklerControllerSwitch * auto_adv_switch)

Definition at line 469 of file sprinkler.cpp.

◆ set_controller_main_switch()

void esphome::sprinkler::Sprinkler::set_controller_main_switch ( SprinklerControllerSwitch * controller_switch)

configure important controller switches

Definition at line 449 of file sprinkler.cpp.

◆ set_controller_multiplier_number()

void esphome::sprinkler::Sprinkler::set_controller_multiplier_number ( SprinklerControllerNumber * multiplier_number)

configure important controller number components

Definition at line 489 of file sprinkler.cpp.

◆ set_controller_queue_enable_switch()

void esphome::sprinkler::Sprinkler::set_controller_queue_enable_switch ( SprinklerControllerSwitch * queue_enable_switch)

Definition at line 473 of file sprinkler.cpp.

◆ set_controller_repeat_number()

void esphome::sprinkler::Sprinkler::set_controller_repeat_number ( SprinklerControllerNumber * repeat_number)

Definition at line 493 of file sprinkler.cpp.

◆ set_controller_reverse_switch()

void esphome::sprinkler::Sprinkler::set_controller_reverse_switch ( SprinklerControllerSwitch * reverse_switch)

Definition at line 477 of file sprinkler.cpp.

◆ set_controller_standby_switch()

void esphome::sprinkler::Sprinkler::set_controller_standby_switch ( SprinklerControllerSwitch * standby_switch)

Definition at line 481 of file sprinkler.cpp.

◆ set_divider()

void esphome::sprinkler::Sprinkler::set_divider ( optional< uint32_t > divider)

sets the multiplier value to '1 / divider' and sets repeat value to divider

Definition at line 554 of file sprinkler.cpp.

◆ set_manual_selection_delay()

void esphome::sprinkler::Sprinkler::set_manual_selection_delay ( uint32_t manual_selection_delay)

set how long the controller should wait to activate a valve after next_valve() or previous_valve() is called

Definition at line 630 of file sprinkler.cpp.

◆ set_multiplier()

void esphome::sprinkler::Sprinkler::set_multiplier ( optional< float > multiplier)

value multiplied by configured run times – used to extend or shorten the cycle

Definition at line 567 of file sprinkler.cpp.

◆ set_next_prev_ignore_disabled_valves()

void esphome::sprinkler::Sprinkler::set_next_prev_ignore_disabled_valves ( bool ignore_disabled)

enable/disable skipping of disabled valves by the next and previous actions

Definition at line 583 of file sprinkler.cpp.

◆ set_pump_start_delay()

void esphome::sprinkler::Sprinkler::set_pump_start_delay ( uint32_t start_delay)

set how long the pump should start after the valve (when the pump is starting)

Definition at line 587 of file sprinkler.cpp.

◆ set_pump_state()

void esphome::sprinkler::Sprinkler::set_pump_state ( SprinklerSwitch * pump_switch,
bool state )

switches on/off a pump "safely" by checking that the new state will not conflict with another controller

Definition at line 1071 of file sprinkler.cpp.

◆ set_pump_stop_delay()

void esphome::sprinkler::Sprinkler::set_pump_stop_delay ( uint32_t stop_delay)

set how long the pump should stop after the valve (when the pump is starting)

Definition at line 592 of file sprinkler.cpp.

◆ set_pump_switch_off_during_valve_open_delay()

void esphome::sprinkler::Sprinkler::set_pump_switch_off_during_valve_open_delay ( bool pump_switch_off_during_valve_open_delay)

if pump_switch_off_during_valve_open_delay is true, the controller will switch off the pump during the valve_open_delay interval

Definition at line 607 of file sprinkler.cpp.

◆ set_queue_enable()

void esphome::sprinkler::Sprinkler::set_queue_enable ( bool queue_enable)

if queue_enable is true, controller will iterate through valves in the queue

Definition at line 688 of file sprinkler.cpp.

◆ set_repeat()

void esphome::sprinkler::Sprinkler::set_repeat ( optional< uint32_t > repeat)

set the number of times to repeat a full cycle

Definition at line 675 of file sprinkler.cpp.

◆ set_reverse()

void esphome::sprinkler::Sprinkler::set_reverse ( bool reverse)

if reverse is true, controller will iterate through all enabled valves in reverse (descending) order

Definition at line 702 of file sprinkler.cpp.

◆ set_standby()

void esphome::sprinkler::Sprinkler::set_standby ( bool standby)

if standby is true, controller will refuse to activate any valves

Definition at line 716 of file sprinkler.cpp.

◆ set_timer_duration_()

void esphome::sprinkler::Sprinkler::set_timer_duration_ ( SprinklerTimerIndex timer_index,
uint32_t time )
protected

time is converted to milliseconds (ms) for set_timeout()

Definition at line 1664 of file sprinkler.cpp.

◆ set_valve_open_delay()

void esphome::sprinkler::Sprinkler::set_valve_open_delay ( uint32_t valve_open_delay)

set how long the controller should wait to open/switch on the valve after it becomes active

Definition at line 611 of file sprinkler.cpp.

◆ set_valve_overlap()

void esphome::sprinkler::Sprinkler::set_valve_overlap ( uint32_t valve_overlap)

set how long the controller should wait after opening a valve before closing the previous valve

Definition at line 620 of file sprinkler.cpp.

◆ set_valve_run_duration()

void esphome::sprinkler::Sprinkler::set_valve_run_duration ( optional< size_t > valve_number,
optional< uint32_t > run_duration )

set how long the valve should remain on/open. run_duration is time in seconds

Definition at line 638 of file sprinkler.cpp.

◆ set_valve_start_delay()

void esphome::sprinkler::Sprinkler::set_valve_start_delay ( uint32_t start_delay)

set how long the valve should start after the pump (when the pump is stopping)

Definition at line 597 of file sprinkler.cpp.

◆ set_valve_stop_delay()

void esphome::sprinkler::Sprinkler::set_valve_stop_delay ( uint32_t stop_delay)

set how long the valve should stop after the pump (when the pump is stopping)

Definition at line 602 of file sprinkler.cpp.

◆ setup()

void esphome::sprinkler::Sprinkler::setup ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 402 of file sprinkler.cpp.

◆ shutdown()

void esphome::sprinkler::Sprinkler::shutdown ( bool clear_queue = false)

turns off all valves, effectively shutting down the system.

Definition at line 939 of file sprinkler.cpp.

◆ sm_timer_callback_()

void esphome::sprinkler::Sprinkler::sm_timer_callback_ ( )
protected

Definition at line 1683 of file sprinkler.cpp.

◆ standby()

bool esphome::sprinkler::Sprinkler::standby ( )

returns true if standby is enabled

Definition at line 802 of file sprinkler.cpp.

◆ start_from_queue()

void esphome::sprinkler::Sprinkler::start_from_queue ( )

starts the controller from the first valve in the queue and disables auto_advance.

if the queue is empty, does nothing.

Definition at line 809 of file sprinkler.cpp.

◆ start_full_cycle()

void esphome::sprinkler::Sprinkler::start_full_cycle ( )

starts a full cycle of all enabled valves and enables auto_advance.

if no valves are enabled, all valves will be enabled.

Definition at line 833 of file sprinkler.cpp.

◆ start_single_valve()

void esphome::sprinkler::Sprinkler::start_single_valve ( optional< size_t > valve_number,
optional< uint32_t > run_duration = nullopt )

activates a single valve and disables auto_advance.

Definition at line 856 of file sprinkler.cpp.

◆ start_timer_()

void esphome::sprinkler::Sprinkler::start_timer_ ( SprinklerTimerIndex timer_index)
protected

Start/cancel/get status of valve timers.

Definition at line 1646 of file sprinkler.cpp.

◆ start_valve_()

void esphome::sprinkler::Sprinkler::start_valve_ ( SprinklerValveRunRequest * req)
protected

loads an available SprinklerValveOperator (valve_op_) based on req and starts it (switches it on).

NOTE: if run_duration is zero, the valve's run_duration will be set based on the valve's configuration.

Definition at line 1418 of file sprinkler.cpp.

◆ state_as_str_()

std::string esphome::sprinkler::Sprinkler::state_as_str_ ( SprinklerState state)
protected

return the specified SprinklerState state as a string

Definition at line 1624 of file sprinkler.cpp.

◆ time_remaining_active_valve()

optional< uint32_t > esphome::sprinkler::Sprinkler::time_remaining_active_valve ( )

returns the amount of time remaining in seconds for the active valve, if any

Definition at line 1202 of file sprinkler.cpp.

◆ time_remaining_current_operation()

optional< uint32_t > esphome::sprinkler::Sprinkler::time_remaining_current_operation ( )

returns the amount of time remaining in seconds for all valves remaining, including the active valve, if any

Definition at line 1216 of file sprinkler.cpp.

◆ timer_active_()

bool esphome::sprinkler::Sprinkler::timer_active_ ( SprinklerTimerIndex timer_index)
protected

returns true if the specified timer is active/running

Definition at line 1662 of file sprinkler.cpp.

◆ timer_cbf_()

std::function< void()> esphome::sprinkler::Sprinkler::timer_cbf_ ( SprinklerTimerIndex timer_index)
protected

Definition at line 1670 of file sprinkler.cpp.

◆ timer_duration_()

uint32_t esphome::sprinkler::Sprinkler::timer_duration_ ( SprinklerTimerIndex timer_index)
protected

returns time in milliseconds (ms)

Definition at line 1668 of file sprinkler.cpp.

◆ total_cycle_time_all_valves()

uint32_t esphome::sprinkler::Sprinkler::total_cycle_time_all_valves ( )

returns the amount of time in seconds required for all valves

Definition at line 1103 of file sprinkler.cpp.

◆ total_cycle_time_enabled_incomplete_valves()

uint32_t esphome::sprinkler::Sprinkler::total_cycle_time_enabled_incomplete_valves ( )

returns the amount of time in seconds required for all enabled & incomplete valves, not including the active valve

Definition at line 1141 of file sprinkler.cpp.

◆ total_cycle_time_enabled_valves()

uint32_t esphome::sprinkler::Sprinkler::total_cycle_time_enabled_valves ( )

returns the amount of time in seconds required for all enabled valves

Definition at line 1119 of file sprinkler.cpp.

◆ total_queue_time()

uint32_t esphome::sprinkler::Sprinkler::total_queue_time ( )

returns the amount of time in seconds required for all valves in the queue

Definition at line 1178 of file sprinkler.cpp.

◆ valve_cycle_complete_()

bool esphome::sprinkler::Sprinkler::valve_cycle_complete_ ( size_t valve_number)
protected

returns true if valve's cycle is flagged as complete

Definition at line 1304 of file sprinkler.cpp.

◆ valve_is_enabled_()

bool esphome::sprinkler::Sprinkler::valve_is_enabled_ ( size_t valve_number)
protected

returns true if valve number is enabled

Definition at line 1286 of file sprinkler.cpp.

◆ valve_name()

const char * esphome::sprinkler::Sprinkler::valve_name ( size_t valve_number)

returns a pointer to a valve's name string object; returns nullptr if valve_number is invalid

Definition at line 997 of file sprinkler.cpp.

◆ valve_pump_switch()

SprinklerSwitch * esphome::sprinkler::Sprinkler::valve_pump_switch ( size_t valve_number)

returns a pointer to a valve's pump switch object

Definition at line 1272 of file sprinkler.cpp.

◆ valve_pump_switch_by_pump_index()

SprinklerSwitch * esphome::sprinkler::Sprinkler::valve_pump_switch_by_pump_index ( size_t pump_index)

returns a pointer to a valve's pump switch object

Definition at line 1279 of file sprinkler.cpp.

◆ valve_run_duration()

uint32_t esphome::sprinkler::Sprinkler::valve_run_duration ( size_t valve_number)

returns valve_number's run duration in seconds

Definition at line 730 of file sprinkler.cpp.

◆ valve_run_duration_adjusted()

uint32_t esphome::sprinkler::Sprinkler::valve_run_duration_adjusted ( size_t valve_number)

returns valve_number's run duration (in seconds) adjusted by multiplier_

Definition at line 744 of file sprinkler.cpp.

◆ valve_selection_callback_()

void esphome::sprinkler::Sprinkler::valve_selection_callback_ ( )
protected

callback functions for timers

Definition at line 1674 of file sprinkler.cpp.

◆ valve_switch()

SprinklerSwitch * esphome::sprinkler::Sprinkler::valve_switch ( size_t valve_number)

returns a pointer to a valve's switch object

Definition at line 1265 of file sprinkler.cpp.

Field Documentation

◆ active_req_

SprinklerValveRunRequest esphome::sprinkler::Sprinkler::active_req_
protected

The valve run request that is currently active.

Definition at line 540 of file sprinkler.h.

◆ auto_adv_sw_

SprinklerControllerSwitch* esphome::sprinkler::Sprinkler::auto_adv_sw_ {nullptr}
protected

Switches we'll present to the front end.

Definition at line 591 of file sprinkler.h.

◆ controller_sw_

SprinklerControllerSwitch* esphome::sprinkler::Sprinkler::controller_sw_ {nullptr}
protected

Definition at line 592 of file sprinkler.h.

◆ manual_selection_delay_

optional<uint32_t> esphome::sprinkler::Sprinkler::manual_selection_delay_
protected

Manual switching delay.

Definition at line 561 of file sprinkler.h.

◆ manual_valve_

optional<size_t> esphome::sprinkler::Sprinkler::manual_valve_
protected

The number of the manually selected valve currently selected.

Definition at line 549 of file sprinkler.h.

◆ max_queue_size_

const uint8_t esphome::sprinkler::Sprinkler::max_queue_size_ {100}
protected

Maximum allowed queue size.

Definition at line 515 of file sprinkler.h.

◆ multiplier_

float esphome::sprinkler::Sprinkler::multiplier_ {1.0}
protected

Sprinkler valve run time multiplier value.

Definition at line 570 of file sprinkler.h.

◆ multiplier_number_

SprinklerControllerNumber* esphome::sprinkler::Sprinkler::multiplier_number_ {nullptr}
protected

Number components we'll present to the front end.

Definition at line 598 of file sprinkler.h.

◆ name_

std::string esphome::sprinkler::Sprinkler::name_
protected

Definition at line 534 of file sprinkler.h.

◆ next_prev_ignore_disabled_

bool esphome::sprinkler::Sprinkler::next_prev_ignore_disabled_ {false}
protected

When set to true, the next and previous actions will skip disabled valves.

Definition at line 518 of file sprinkler.h.

◆ next_req_

SprinklerValveRunRequest esphome::sprinkler::Sprinkler::next_req_
protected

The next run request for the controller to consume after active_req_ is complete.

Definition at line 543 of file sprinkler.h.

◆ other_controllers_

std::vector<Sprinkler *> esphome::sprinkler::Sprinkler::other_controllers_
protected

Other Sprinkler instances we should be aware of (used to check if pumps are in use)

Definition at line 588 of file sprinkler.h.

◆ paused_valve_

optional<size_t> esphome::sprinkler::Sprinkler::paused_valve_
protected

The number of the valve to resume from (if paused)

Definition at line 552 of file sprinkler.h.

◆ prev_req_

SprinklerValveRunRequest esphome::sprinkler::Sprinkler::prev_req_
protected

The previous run request the controller processed.

Definition at line 546 of file sprinkler.h.

◆ pump_

std::vector<SprinklerSwitch> esphome::sprinkler::Sprinkler::pump_
protected

Sprinkler valve pump objects.

Definition at line 576 of file sprinkler.h.

◆ pump_switch_off_during_valve_open_delay_

bool esphome::sprinkler::Sprinkler::pump_switch_off_during_valve_open_delay_ {false}
protected

Pump should be off during valve_open_delay interval.

Definition at line 521 of file sprinkler.h.

◆ queue_enable_sw_

SprinklerControllerSwitch* esphome::sprinkler::Sprinkler::queue_enable_sw_ {nullptr}
protected

Definition at line 593 of file sprinkler.h.

◆ queued_valves_

std::vector<SprinklerQueueItem> esphome::sprinkler::Sprinkler::queued_valves_
protected

Queue of valves to activate next, regardless of auto-advance.

Definition at line 573 of file sprinkler.h.

◆ repeat_count_

uint32_t esphome::sprinkler::Sprinkler::repeat_count_ {0}
protected

Number of times the full cycle has been repeated.

Definition at line 567 of file sprinkler.h.

◆ repeat_number_

SprinklerControllerNumber* esphome::sprinkler::Sprinkler::repeat_number_ {nullptr}
protected

Definition at line 599 of file sprinkler.h.

◆ resume_duration_

optional<uint32_t> esphome::sprinkler::Sprinkler::resume_duration_
protected

Set from time_remaining() when paused.

Definition at line 558 of file sprinkler.h.

◆ reverse_sw_

SprinklerControllerSwitch* esphome::sprinkler::Sprinkler::reverse_sw_ {nullptr}
protected

Definition at line 594 of file sprinkler.h.

◆ sprinkler_resumeorstart_action_

std::unique_ptr<ResumeOrStartAction<> > esphome::sprinkler::Sprinkler::sprinkler_resumeorstart_action_
protected

Definition at line 603 of file sprinkler.h.

◆ sprinkler_shutdown_action_

std::unique_ptr<ShutdownAction<> > esphome::sprinkler::Sprinkler::sprinkler_shutdown_action_
protected

Definition at line 601 of file sprinkler.h.

◆ sprinkler_standby_shutdown_action_

std::unique_ptr<ShutdownAction<> > esphome::sprinkler::Sprinkler::sprinkler_standby_shutdown_action_
protected

Definition at line 602 of file sprinkler.h.

◆ sprinkler_standby_turn_on_automation_

std::unique_ptr<Automation<> > esphome::sprinkler::Sprinkler::sprinkler_standby_turn_on_automation_
protected

Definition at line 607 of file sprinkler.h.

◆ sprinkler_turn_off_automation_

std::unique_ptr<Automation<> > esphome::sprinkler::Sprinkler::sprinkler_turn_off_automation_
protected

Definition at line 605 of file sprinkler.h.

◆ sprinkler_turn_on_automation_

std::unique_ptr<Automation<> > esphome::sprinkler::Sprinkler::sprinkler_turn_on_automation_
protected

Definition at line 606 of file sprinkler.h.

◆ standby_sw_

SprinklerControllerSwitch* esphome::sprinkler::Sprinkler::standby_sw_ {nullptr}
protected

Definition at line 595 of file sprinkler.h.

◆ start_delay_

uint32_t esphome::sprinkler::Sprinkler::start_delay_ {0}
protected

Pump start/stop delay intervals.

Definition at line 531 of file sprinkler.h.

◆ start_delay_is_valve_delay_

bool esphome::sprinkler::Sprinkler::start_delay_is_valve_delay_ {false}
protected

Pump start/stop delay interval types.

Definition at line 527 of file sprinkler.h.

◆ state_

SprinklerState esphome::sprinkler::Sprinkler::state_ {IDLE}
protected

Sprinkler controller state.

Definition at line 537 of file sprinkler.h.

◆ stop_delay_

uint32_t esphome::sprinkler::Sprinkler::stop_delay_ {0}
protected

Definition at line 532 of file sprinkler.h.

◆ stop_delay_is_valve_delay_

bool esphome::sprinkler::Sprinkler::stop_delay_is_valve_delay_ {false}
protected

Definition at line 528 of file sprinkler.h.

◆ switching_delay_

optional<uint32_t> esphome::sprinkler::Sprinkler::switching_delay_
protected

Valve switching delay.

Definition at line 564 of file sprinkler.h.

◆ target_repeats_

optional<uint32_t> esphome::sprinkler::Sprinkler::target_repeats_
protected

Set the number of times to repeat a full cycle.

Definition at line 555 of file sprinkler.h.

◆ timer_

std::vector<SprinklerTimer> esphome::sprinkler::Sprinkler::timer_ {}
protected

Valve control timers.

Definition at line 585 of file sprinkler.h.

◆ valve_

std::vector<SprinklerValve> esphome::sprinkler::Sprinkler::valve_
protected

Sprinkler valve objects.

Definition at line 579 of file sprinkler.h.

◆ valve_op_

std::vector<SprinklerValveOperator> esphome::sprinkler::Sprinkler::valve_op_ {2}
protected

Sprinkler valve operator objects.

Definition at line 582 of file sprinkler.h.

◆ valve_overlap_

bool esphome::sprinkler::Sprinkler::valve_overlap_ {false}
protected

Sprinkler valve cycle should overlap.

Definition at line 524 of file sprinkler.h.


The documentation for this class was generated from the following files: