ESPHome 2025.6.2
Loading...
Searching...
No Matches
esphome::demo::DemoValve Class Reference

#include <demo_valve.h>

Inheritance diagram for esphome::demo::DemoValve:
esphome::valve::Valve esphome::EntityBase esphome::EntityBase_DeviceClass

Public Member Functions

valve::ValveTraits get_traits () override
 
void set_type (DemoValveType type)
 
- Public Member Functions inherited from esphome::valve::Valve
 Valve ()
 
ValveCall make_call ()
 Construct a new valve call used to control the valve.
 
void add_on_state_callback (std::function< void()> &&f)
 
void publish_state (bool save=true)
 Publish the current state of the valve.
 
bool is_fully_open () const
 Helper method to check if the valve is fully open. Equivalent to comparing .position against 1.0.
 
bool is_fully_closed () const
 Helper method to check if the valve is fully closed. Equivalent to comparing .position against 0.0.
 
- Public Member Functions inherited from esphome::EntityBase
const StringRefget_name () const
 
void set_name (const char *name)
 
bool has_own_name () const
 
std::string get_object_id () const
 
void set_object_id (const char *object_id)
 
uint32_t get_object_id_hash ()
 
bool is_internal () const
 
void set_internal (bool internal)
 
bool is_disabled_by_default () const
 
void set_disabled_by_default (bool disabled_by_default)
 
EntityCategory get_entity_category () const
 
void set_entity_category (EntityCategory entity_category)
 
std::string get_icon () const
 
void set_icon (const char *icon)
 
bool has_state () const
 
void set_has_state (bool state)
 
- Public Member Functions inherited from esphome::EntityBase_DeviceClass
std::string get_device_class ()
 Get the device class, using the manual override if set.
 
void set_device_class (const char *device_class)
 Manually set the device class.
 

Protected Member Functions

void control (const valve::ValveCall &call) override
 
- Protected Member Functions inherited from esphome::valve::Valve
optional< ValveRestoreStaterestore_state_ ()
 
- Protected Member Functions inherited from esphome::EntityBase
virtual uint32_t hash_base ()
 The hash_base() function has been deprecated.
 
void calc_object_id_ ()
 

Protected Attributes

DemoValveType type_ {}
 
- Protected Attributes inherited from esphome::valve::Valve
friend ValveCall
 
CallbackManager< void()> state_callback_ {}
 
ESPPreferenceObject rtc_
 
- Protected Attributes inherited from esphome::EntityBase
StringRef name_
 
const char * object_id_c_str_ {nullptr}
 
const char * icon_c_str_ {nullptr}
 
uint32_t object_id_hash_ {}
 
struct esphome::EntityBase::EntityFlags flags_
 
- Protected Attributes inherited from esphome::EntityBase_DeviceClass
const char * device_class_ {nullptr}
 Device class override.
 

Additional Inherited Members

- Data Fields inherited from esphome::valve::Valve
ValveOperation current_operation {VALVE_OPERATION_IDLE}
 The current operation of the valve (idle, opening, closing).
 
float position
 The position of the valve from 0.0 (fully closed) to 1.0 (fully open).
 

Detailed Description

Definition at line 13 of file demo_valve.h.

Member Function Documentation

◆ control()

void esphome::demo::DemoValve::control ( const valve::ValveCall & call)
inlineoverrideprotectedvirtual

Implements esphome::valve::Valve.

Definition at line 28 of file demo_valve.h.

◆ get_traits()

valve::ValveTraits esphome::demo::DemoValve::get_traits ( )
inlineoverridevirtual

Implements esphome::valve::Valve.

Definition at line 15 of file demo_valve.h.

◆ set_type()

void esphome::demo::DemoValve::set_type ( DemoValveType type)
inline

Definition at line 25 of file demo_valve.h.

Field Documentation

◆ type_

DemoValveType esphome::demo::DemoValve::type_ {}
protected

Definition at line 50 of file demo_valve.h.


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