ESPHome  2024.3.1
Public Member Functions | Protected Attributes
esphome::sprinkler::SprinklerSwitch Class Reference

#include <sprinkler.h>

Public Member Functions

 SprinklerSwitch ()
 
 SprinklerSwitch (switch_::Switch *sprinkler_switch)
 
 SprinklerSwitch (switch_::Switch *off_switch, switch_::Switch *on_switch, uint32_t pulse_duration)
 
bool is_latching_valve ()
 
void loop ()
 
uint32_t pulse_duration ()
 
bool state ()
 
void set_off_switch (switch_::Switch *off_switch)
 
void set_on_switch (switch_::Switch *on_switch)
 
void set_pulse_duration (uint32_t pulse_duration)
 
void sync_valve_state (bool latch_state)
 
void turn_off ()
 
void turn_on ()
 
switch_::Switchoff_switch ()
 
switch_::Switchon_switch ()
 

Protected Attributes

bool state_ {false}
 
uint32_t pulse_duration_ {0}
 
uint64_t pinned_millis_ {0}
 
switch_::Switchoff_switch_ {nullptr}
 
switch_::Switchon_switch_ {nullptr}
 

Detailed Description

Definition at line 47 of file sprinkler.h.

Constructor & Destructor Documentation

◆ SprinklerSwitch() [1/3]

esphome::sprinkler::SprinklerSwitch::SprinklerSwitch ( )

Definition at line 15 of file sprinkler.cpp.

◆ SprinklerSwitch() [2/3]

esphome::sprinkler::SprinklerSwitch::SprinklerSwitch ( switch_::Switch sprinkler_switch)

Definition at line 16 of file sprinkler.cpp.

◆ SprinklerSwitch() [3/3]

esphome::sprinkler::SprinklerSwitch::SprinklerSwitch ( switch_::Switch off_switch,
switch_::Switch on_switch,
uint32_t  pulse_duration 
)

Definition at line 17 of file sprinkler.cpp.

Member Function Documentation

◆ is_latching_valve()

bool esphome::sprinkler::SprinklerSwitch::is_latching_valve ( )

Definition at line 20 of file sprinkler.cpp.

◆ loop()

void esphome::sprinkler::SprinklerSwitch::loop ( )

Definition at line 22 of file sprinkler.cpp.

◆ off_switch()

switch_::Switch* esphome::sprinkler::SprinklerSwitch::off_switch ( )
inline

Definition at line 64 of file sprinkler.h.

◆ on_switch()

switch_::Switch* esphome::sprinkler::SprinklerSwitch::on_switch ( )
inline

Definition at line 65 of file sprinkler.h.

◆ pulse_duration()

uint32_t esphome::sprinkler::SprinklerSwitch::pulse_duration ( )
inline

Definition at line 55 of file sprinkler.h.

◆ set_off_switch()

void esphome::sprinkler::SprinklerSwitch::set_off_switch ( switch_::Switch off_switch)
inline

Definition at line 57 of file sprinkler.h.

◆ set_on_switch()

void esphome::sprinkler::SprinklerSwitch::set_on_switch ( switch_::Switch on_switch)
inline

Definition at line 58 of file sprinkler.h.

◆ set_pulse_duration()

void esphome::sprinkler::SprinklerSwitch::set_pulse_duration ( uint32_t  pulse_duration)
inline

Definition at line 59 of file sprinkler.h.

◆ state()

bool esphome::sprinkler::SprinklerSwitch::state ( )

Definition at line 64 of file sprinkler.cpp.

◆ sync_valve_state()

void esphome::sprinkler::SprinklerSwitch::sync_valve_state ( bool  latch_state)

Definition at line 71 of file sprinkler.cpp.

◆ turn_off()

void esphome::sprinkler::SprinklerSwitch::turn_off ( )

Definition at line 34 of file sprinkler.cpp.

◆ turn_on()

void esphome::sprinkler::SprinklerSwitch::turn_on ( )

Definition at line 49 of file sprinkler.cpp.

Field Documentation

◆ off_switch_

switch_::Switch* esphome::sprinkler::SprinklerSwitch::off_switch_ {nullptr}
protected

Definition at line 71 of file sprinkler.h.

◆ on_switch_

switch_::Switch* esphome::sprinkler::SprinklerSwitch::on_switch_ {nullptr}
protected

Definition at line 72 of file sprinkler.h.

◆ pinned_millis_

uint64_t esphome::sprinkler::SprinklerSwitch::pinned_millis_ {0}
protected

Definition at line 70 of file sprinkler.h.

◆ pulse_duration_

uint32_t esphome::sprinkler::SprinklerSwitch::pulse_duration_ {0}
protected

Definition at line 69 of file sprinkler.h.

◆ state_

bool esphome::sprinkler::SprinklerSwitch::state_ {false}
protected

Definition at line 68 of file sprinkler.h.


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