ESPHome  2024.10.2
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::valve::ValveCall Class Reference

#include <valve.h>

Public Member Functions

 ValveCall (Valve *parent)
 
ValveCallset_command (const char *command)
 Set the command as a string, "STOP", "OPEN", "CLOSE", "TOGGLE". More...
 
ValveCallset_command_open ()
 Set the command to open the valve. More...
 
ValveCallset_command_close ()
 Set the command to close the valve. More...
 
ValveCallset_command_stop ()
 Set the command to stop the valve. More...
 
ValveCallset_command_toggle ()
 Set the command to toggle the valve. More...
 
ValveCallset_position (float position)
 Set the call to a certain target position. More...
 
ValveCallset_stop (bool stop)
 Set whether this valve call should stop the valve. More...
 
void perform ()
 Perform the valve call. More...
 
const optional< float > & get_position () const
 
bool get_stop () const
 
const optional< bool > & get_toggle () const
 

Protected Member Functions

void validate_ ()
 

Protected Attributes

Valveparent_
 
bool stop_ {false}
 
optional< float > position_ {}
 
optional< bool > toggle_ {}
 

Detailed Description

Definition at line 29 of file valve.h.

Constructor & Destructor Documentation

◆ ValveCall()

esphome::valve::ValveCall::ValveCall ( Valve parent)

Definition at line 36 of file valve.cpp.

Member Function Documentation

◆ get_position()

const optional< float > & esphome::valve::ValveCall::get_position ( ) const

Definition at line 90 of file valve.cpp.

◆ get_stop()

bool esphome::valve::ValveCall::get_stop ( ) const

Definition at line 125 of file valve.cpp.

◆ get_toggle()

const optional< bool > & esphome::valve::ValveCall::get_toggle ( ) const

Definition at line 91 of file valve.cpp.

◆ perform()

void esphome::valve::ValveCall::perform ( )

Perform the valve call.

Definition at line 71 of file valve.cpp.

◆ set_command()

ValveCall & esphome::valve::ValveCall::set_command ( const char *  command)

Set the command as a string, "STOP", "OPEN", "CLOSE", "TOGGLE".

Definition at line 37 of file valve.cpp.

◆ set_command_close()

ValveCall & esphome::valve::ValveCall::set_command_close ( )

Set the command to close the valve.

Definition at line 55 of file valve.cpp.

◆ set_command_open()

ValveCall & esphome::valve::ValveCall::set_command_open ( )

Set the command to open the valve.

Definition at line 51 of file valve.cpp.

◆ set_command_stop()

ValveCall & esphome::valve::ValveCall::set_command_stop ( )

Set the command to stop the valve.

Definition at line 59 of file valve.cpp.

◆ set_command_toggle()

ValveCall & esphome::valve::ValveCall::set_command_toggle ( )

Set the command to toggle the valve.

Definition at line 63 of file valve.cpp.

◆ set_position()

ValveCall & esphome::valve::ValveCall::set_position ( float  position)

Set the call to a certain target position.

Definition at line 67 of file valve.cpp.

◆ set_stop()

ValveCall & esphome::valve::ValveCall::set_stop ( bool  stop)

Set whether this valve call should stop the valve.

Definition at line 121 of file valve.cpp.

◆ validate_()

void esphome::valve::ValveCall::validate_ ( )
protected

Definition at line 92 of file valve.cpp.

Field Documentation

◆ parent_

Valve* esphome::valve::ValveCall::parent_
protected

Definition at line 58 of file valve.h.

◆ position_

optional<float> esphome::valve::ValveCall::position_ {}
protected

Definition at line 60 of file valve.h.

◆ stop_

bool esphome::valve::ValveCall::stop_ {false}
protected

Definition at line 59 of file valve.h.

◆ toggle_

optional<bool> esphome::valve::ValveCall::toggle_ {}
protected

Definition at line 61 of file valve.h.


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