ESPHome  2024.9.2
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::ezo_pmp::EzoPMP Class Reference

#include <ezo_pmp.h>

Inheritance diagram for esphome::ezo_pmp::EzoPMP:
esphome::PollingComponent esphome::i2c::I2CDevice esphome::Component

Public Member Functions

void dump_config () override
 
float get_setup_priority () const override
 
void loop () override
 
void update () override
 
void set_current_volume_dosed (sensor::Sensor *current_volume_dosed)
 
void set_total_volume_dosed (sensor::Sensor *total_volume_dosed)
 
void set_absolute_total_volume_dosed (sensor::Sensor *absolute_total_volume_dosed)
 
void set_pump_voltage (sensor::Sensor *pump_voltage)
 
void set_last_volume_requested (sensor::Sensor *last_volume_requested)
 
void set_max_flow_rate (sensor::Sensor *max_flow_rate)
 
void set_is_dosing (binary_sensor::BinarySensor *is_dosing)
 
void set_is_paused (binary_sensor::BinarySensor *is_paused)
 
void set_dosing_mode (text_sensor::TextSensor *dosing_mode)
 
void set_calibration_status (text_sensor::TextSensor *calibration_status)
 
void find ()
 
void dose_continuously ()
 
void dose_volume (double volume)
 
void dose_volume_over_time (double volume, int duration)
 
void dose_with_constant_flow_rate (double volume, int duration)
 
void set_calibration_volume (double volume)
 
void clear_total_volume_dosed ()
 
void clear_calibration ()
 
void pause_dosing ()
 
void stop_dosing ()
 
void change_i2c_address (int address)
 
void exec_arbitrary_command (const std::basic_string< char > &command)
 
- Public Member Functions inherited from esphome::PollingComponent
 PollingComponent ()
 
 PollingComponent (uint32_t update_interval)
 Initialize this polling component with the given update interval in ms. More...
 
virtual void set_update_interval (uint32_t update_interval)
 Manually set the update interval in ms for this polling object. More...
 
void call_setup () override
 
virtual uint32_t get_update_interval () const
 Get the update interval in ms of this sensor. More...
 
void start_poller ()
 
void stop_poller ()
 
- Public Member Functions inherited from esphome::Component
virtual void setup ()
 Where the component's initialization should happen. More...
 
float get_actual_setup_priority () const
 
void set_setup_priority (float priority)
 
virtual float get_loop_priority () const
 priority of loop(). More...
 
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. More...
 
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. More...
 
const char * get_component_source () const
 Get the integration where this component was declared as a string. More...
 
- Public Member Functions inherited from esphome::i2c::I2CDevice
 I2CDevice ()=default
 we use the C++ default constructor More...
 
void set_i2c_address (uint8_t address)
 We store the address of the device on the bus. More...
 
void set_i2c_bus (I2CBus *bus)
 we store the pointer to the I2CBus to use More...
 
I2CRegister reg (uint8_t a_register)
 calls the I2CRegister constructor More...
 
I2CRegister16 reg16 (uint16_t a_register)
 calls the I2CRegister16 constructor More...
 
ErrorCode read (uint8_t *data, size_t len)
 reads an array of bytes from the device using an I2CBus More...
 
ErrorCode read_register (uint8_t a_register, uint8_t *data, size_t len, bool stop=true)
 reads an array of bytes from a specific register in the I²C device More...
 
ErrorCode read_register16 (uint16_t a_register, uint8_t *data, size_t len, bool stop=true)
 reads an array of bytes from a specific register in the I²C device More...
 
ErrorCode write (const uint8_t *data, size_t len, bool stop=true)
 writes an array of bytes to a device using an I2CBus More...
 
ErrorCode write_register (uint8_t a_register, const uint8_t *data, size_t len, bool stop=true)
 writes an array of bytes to a specific register in the I²C device More...
 
ErrorCode write_register16 (uint16_t a_register, const uint8_t *data, size_t len, bool stop=true)
 write an array of bytes to a specific register in the I²C device More...
 
bool read_bytes (uint8_t a_register, uint8_t *data, uint8_t len)
 Compat APIs All methods below have been added for compatibility reasons. More...
 
bool read_bytes_raw (uint8_t *data, uint8_t len)
 
template<size_t N>
optional< std::array< uint8_t, N > > read_bytes (uint8_t a_register)
 
template<size_t N>
optional< std::array< uint8_t, N > > read_bytes_raw ()
 
bool read_bytes_16 (uint8_t a_register, uint16_t *data, uint8_t len)
 
bool read_byte (uint8_t a_register, uint8_t *data, bool stop=true)
 
optional< uint8_t > read_byte (uint8_t a_register)
 
bool read_byte_16 (uint8_t a_register, uint16_t *data)
 
bool write_bytes (uint8_t a_register, const uint8_t *data, uint8_t len, bool stop=true)
 
bool write_bytes (uint8_t a_register, const std::vector< uint8_t > &data)
 
template<size_t N>
bool write_bytes (uint8_t a_register, const std::array< uint8_t, N > &data)
 
bool write_bytes_16 (uint8_t a_register, const uint16_t *data, uint8_t len)
 
bool write_byte (uint8_t a_register, uint8_t data, bool stop=true)
 
bool write_byte_16 (uint8_t a_register, uint16_t data)
 

Protected Member Functions

void send_next_command_ ()
 
void read_command_result_ ()
 
void clear_current_command_ ()
 
void queue_command_ (uint16_t command, double volume, int duration, bool should_schedule)
 
void pop_next_command_ ()
 
uint16_t peek_next_command_ ()
 
- Protected Member Functions inherited from esphome::Component
virtual void call_loop ()
 
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. More...
 
void set_interval (uint32_t interval, std::function< void()> &&f)
 
bool cancel_interval (const std::string &name)
 Cancel an interval function. More...
 
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. More...
 
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. More...
 
void set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a unique name. More...
 
void set_timeout (uint32_t timeout, std::function< void()> &&f)
 
bool cancel_timeout (const std::string &name)
 Cancel a timeout function. More...
 
void defer (const std::string &name, std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
void defer (std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
bool cancel_defer (const std::string &name)
 Cancel a defer callback using the specified name, name must not be empty. More...
 

Protected Attributes

uint32_t start_time_ = 0
 
uint32_t wait_time_ = 0
 
bool is_waiting_ = false
 
bool is_first_read_ = true
 
uint16_t next_command_ = 0
 
double next_command_volume_ = 0
 
int next_command_duration_ = 0
 
uint16_t next_command_queue_ [10]
 
double next_command_volume_queue_ [10]
 
int next_command_duration_queue_ [10]
 
int next_command_queue_head_ = 0
 
int next_command_queue_last_ = 0
 
int next_command_queue_length_ = 0
 
uint16_t current_command_ = 0
 
bool is_paused_flag_ = false
 
bool is_dosing_flag_ = false
 
const char * arbitrary_command_ {nullptr}
 
sensor::Sensorcurrent_volume_dosed_ {nullptr}
 
sensor::Sensortotal_volume_dosed_ {nullptr}
 
sensor::Sensorabsolute_total_volume_dosed_ {nullptr}
 
sensor::Sensorpump_voltage_ {nullptr}
 
sensor::Sensormax_flow_rate_ {nullptr}
 
sensor::Sensorlast_volume_requested_ {nullptr}
 
binary_sensor::BinarySensoris_dosing_ {nullptr}
 
binary_sensor::BinarySensoris_paused_ {nullptr}
 
text_sensor::TextSensordosing_mode_ {nullptr}
 
text_sensor::TextSensorcalibration_status_ {nullptr}
 
- Protected Attributes inherited from esphome::PollingComponent
uint32_t update_interval_
 
- Protected Attributes inherited from esphome::Component
uint32_t component_state_ {0x0000}
 State of this component. More...
 
float setup_priority_override_ {NAN}
 
const char * component_source_ {nullptr}
 
- Protected Attributes inherited from esphome::i2c::I2CDevice
uint8_t address_ {0x00}
 store the address of the device on the bus More...
 
I2CBusbus_ {nullptr}
 pointer to I2CBus instance More...
 

Detailed Description

Definition at line 23 of file ezo_pmp.h.

Member Function Documentation

◆ change_i2c_address()

void esphome::ezo_pmp::EzoPMP::change_i2c_address ( int  address)

Definition at line 533 of file ezo_pmp.cpp.

◆ clear_calibration()

void esphome::ezo_pmp::EzoPMP::clear_calibration ( )

Definition at line 520 of file ezo_pmp.cpp.

◆ clear_current_command_()

void esphome::ezo_pmp::EzoPMP::clear_current_command_ ( )
protected

Definition at line 101 of file ezo_pmp.cpp.

◆ clear_total_volume_dosed()

void esphome::ezo_pmp::EzoPMP::clear_total_volume_dosed ( )

Definition at line 513 of file ezo_pmp.cpp.

◆ dose_continuously()

void esphome::ezo_pmp::EzoPMP::dose_continuously ( )

Definition at line 483 of file ezo_pmp.cpp.

◆ dose_volume()

void esphome::ezo_pmp::EzoPMP::dose_volume ( double  volume)

Definition at line 489 of file ezo_pmp.cpp.

◆ dose_volume_over_time()

void esphome::ezo_pmp::EzoPMP::dose_volume_over_time ( double  volume,
int  duration 
)

Definition at line 495 of file ezo_pmp.cpp.

◆ dose_with_constant_flow_rate()

void esphome::ezo_pmp::EzoPMP::dose_with_constant_flow_rate ( double  volume,
int  duration 
)

Definition at line 501 of file ezo_pmp.cpp.

◆ dump_config()

void esphome::ezo_pmp::EzoPMP::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 41 of file ezo_pmp.cpp.

◆ exec_arbitrary_command()

void esphome::ezo_pmp::EzoPMP::exec_arbitrary_command ( const std::basic_string< char > &  command)

Definition at line 537 of file ezo_pmp.cpp.

◆ find()

void esphome::ezo_pmp::EzoPMP::find ( )

Definition at line 481 of file ezo_pmp.cpp.

◆ get_setup_priority()

float esphome::ezo_pmp::EzoPMP::get_setup_priority ( ) const
inlineoverridevirtual

Reimplemented from esphome::Component.

Definition at line 26 of file ezo_pmp.h.

◆ loop()

void esphome::ezo_pmp::EzoPMP::loop ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 81 of file ezo_pmp.cpp.

◆ pause_dosing()

void esphome::ezo_pmp::EzoPMP::pause_dosing ( )

Definition at line 526 of file ezo_pmp.cpp.

◆ peek_next_command_()

uint16_t esphome::ezo_pmp::EzoPMP::peek_next_command_ ( )
protected

Definition at line 446 of file ezo_pmp.cpp.

◆ pop_next_command_()

void esphome::ezo_pmp::EzoPMP::pop_next_command_ ( )
protected

Definition at line 423 of file ezo_pmp.cpp.

◆ queue_command_()

void esphome::ezo_pmp::EzoPMP::queue_command_ ( uint16_t  command,
double  volume,
int  duration,
bool  should_schedule 
)
protected

Definition at line 454 of file ezo_pmp.cpp.

◆ read_command_result_()

void esphome::ezo_pmp::EzoPMP::read_command_result_ ( )
protected

Definition at line 106 of file ezo_pmp.cpp.

◆ send_next_command_()

void esphome::ezo_pmp::EzoPMP::send_next_command_ ( )
protected

Definition at line 308 of file ezo_pmp.cpp.

◆ set_absolute_total_volume_dosed()

void esphome::ezo_pmp::EzoPMP::set_absolute_total_volume_dosed ( sensor::Sensor absolute_total_volume_dosed)
inline

Definition at line 34 of file ezo_pmp.h.

◆ set_calibration_status()

void esphome::ezo_pmp::EzoPMP::set_calibration_status ( text_sensor::TextSensor calibration_status)
inline

Definition at line 51 of file ezo_pmp.h.

◆ set_calibration_volume()

void esphome::ezo_pmp::EzoPMP::set_calibration_volume ( double  volume)

Definition at line 507 of file ezo_pmp.cpp.

◆ set_current_volume_dosed()

void esphome::ezo_pmp::EzoPMP::set_current_volume_dosed ( sensor::Sensor current_volume_dosed)
inline

Definition at line 32 of file ezo_pmp.h.

◆ set_dosing_mode()

void esphome::ezo_pmp::EzoPMP::set_dosing_mode ( text_sensor::TextSensor dosing_mode)
inline

Definition at line 50 of file ezo_pmp.h.

◆ set_is_dosing()

void esphome::ezo_pmp::EzoPMP::set_is_dosing ( binary_sensor::BinarySensor is_dosing)
inline

Definition at line 45 of file ezo_pmp.h.

◆ set_is_paused()

void esphome::ezo_pmp::EzoPMP::set_is_paused ( binary_sensor::BinarySensor is_paused)
inline

Definition at line 46 of file ezo_pmp.h.

◆ set_last_volume_requested()

void esphome::ezo_pmp::EzoPMP::set_last_volume_requested ( sensor::Sensor last_volume_requested)
inline

Definition at line 38 of file ezo_pmp.h.

◆ set_max_flow_rate()

void esphome::ezo_pmp::EzoPMP::set_max_flow_rate ( sensor::Sensor max_flow_rate)
inline

Definition at line 41 of file ezo_pmp.h.

◆ set_pump_voltage()

void esphome::ezo_pmp::EzoPMP::set_pump_voltage ( sensor::Sensor pump_voltage)
inline

Definition at line 37 of file ezo_pmp.h.

◆ set_total_volume_dosed()

void esphome::ezo_pmp::EzoPMP::set_total_volume_dosed ( sensor::Sensor total_volume_dosed)
inline

Definition at line 33 of file ezo_pmp.h.

◆ stop_dosing()

void esphome::ezo_pmp::EzoPMP::stop_dosing ( )

Definition at line 531 of file ezo_pmp.cpp.

◆ update()

void esphome::ezo_pmp::EzoPMP::update ( )
overridevirtual

Implements esphome::PollingComponent.

Definition at line 49 of file ezo_pmp.cpp.

Field Documentation

◆ absolute_total_volume_dosed_

sensor::Sensor* esphome::ezo_pmp::EzoPMP::absolute_total_volume_dosed_ {nullptr}
protected

Definition at line 101 of file ezo_pmp.h.

◆ arbitrary_command_

const char* esphome::ezo_pmp::EzoPMP::arbitrary_command_ {nullptr}
protected

Definition at line 89 of file ezo_pmp.h.

◆ calibration_status_

text_sensor::TextSensor* esphome::ezo_pmp::EzoPMP::calibration_status_ {nullptr}
protected

Definition at line 114 of file ezo_pmp.h.

◆ current_command_

uint16_t esphome::ezo_pmp::EzoPMP::current_command_ = 0
protected

Definition at line 85 of file ezo_pmp.h.

◆ current_volume_dosed_

sensor::Sensor* esphome::ezo_pmp::EzoPMP::current_volume_dosed_ {nullptr}
protected

Definition at line 99 of file ezo_pmp.h.

◆ dosing_mode_

text_sensor::TextSensor* esphome::ezo_pmp::EzoPMP::dosing_mode_ {nullptr}
protected

Definition at line 113 of file ezo_pmp.h.

◆ is_dosing_

binary_sensor::BinarySensor* esphome::ezo_pmp::EzoPMP::is_dosing_ {nullptr}
protected

Definition at line 108 of file ezo_pmp.h.

◆ is_dosing_flag_

bool esphome::ezo_pmp::EzoPMP::is_dosing_flag_ = false
protected

Definition at line 87 of file ezo_pmp.h.

◆ is_first_read_

bool esphome::ezo_pmp::EzoPMP::is_first_read_ = true
protected

Definition at line 72 of file ezo_pmp.h.

◆ is_paused_

binary_sensor::BinarySensor* esphome::ezo_pmp::EzoPMP::is_paused_ {nullptr}
protected

Definition at line 109 of file ezo_pmp.h.

◆ is_paused_flag_

bool esphome::ezo_pmp::EzoPMP::is_paused_flag_ = false
protected

Definition at line 86 of file ezo_pmp.h.

◆ is_waiting_

bool esphome::ezo_pmp::EzoPMP::is_waiting_ = false
protected

Definition at line 71 of file ezo_pmp.h.

◆ last_volume_requested_

sensor::Sensor* esphome::ezo_pmp::EzoPMP::last_volume_requested_ {nullptr}
protected

Definition at line 104 of file ezo_pmp.h.

◆ max_flow_rate_

sensor::Sensor* esphome::ezo_pmp::EzoPMP::max_flow_rate_ {nullptr}
protected

Definition at line 103 of file ezo_pmp.h.

◆ next_command_

uint16_t esphome::ezo_pmp::EzoPMP::next_command_ = 0
protected

Definition at line 74 of file ezo_pmp.h.

◆ next_command_duration_

int esphome::ezo_pmp::EzoPMP::next_command_duration_ = 0
protected

Definition at line 76 of file ezo_pmp.h.

◆ next_command_duration_queue_

int esphome::ezo_pmp::EzoPMP::next_command_duration_queue_[10]
protected

Definition at line 80 of file ezo_pmp.h.

◆ next_command_queue_

uint16_t esphome::ezo_pmp::EzoPMP::next_command_queue_[10]
protected

Definition at line 78 of file ezo_pmp.h.

◆ next_command_queue_head_

int esphome::ezo_pmp::EzoPMP::next_command_queue_head_ = 0
protected

Definition at line 81 of file ezo_pmp.h.

◆ next_command_queue_last_

int esphome::ezo_pmp::EzoPMP::next_command_queue_last_ = 0
protected

Definition at line 82 of file ezo_pmp.h.

◆ next_command_queue_length_

int esphome::ezo_pmp::EzoPMP::next_command_queue_length_ = 0
protected

Definition at line 83 of file ezo_pmp.h.

◆ next_command_volume_

double esphome::ezo_pmp::EzoPMP::next_command_volume_ = 0
protected

Definition at line 75 of file ezo_pmp.h.

◆ next_command_volume_queue_

double esphome::ezo_pmp::EzoPMP::next_command_volume_queue_[10]
protected

Definition at line 79 of file ezo_pmp.h.

◆ pump_voltage_

sensor::Sensor* esphome::ezo_pmp::EzoPMP::pump_voltage_ {nullptr}
protected

Definition at line 102 of file ezo_pmp.h.

◆ start_time_

uint32_t esphome::ezo_pmp::EzoPMP::start_time_ = 0
protected

Definition at line 69 of file ezo_pmp.h.

◆ total_volume_dosed_

sensor::Sensor* esphome::ezo_pmp::EzoPMP::total_volume_dosed_ {nullptr}
protected

Definition at line 100 of file ezo_pmp.h.

◆ wait_time_

uint32_t esphome::ezo_pmp::EzoPMP::wait_time_ = 0
protected

Definition at line 70 of file ezo_pmp.h.


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