ESPHome  2024.12.2
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
esphome::opentherm::OpenthermHub Class Reference

#include <hub.h>

Inheritance diagram for esphome::opentherm::OpenthermHub:
esphome::Component

Public Member Functions

 OpenthermHub ()
 
void process_response (OpenthermData &data)
 
void set_in_pin (InternalGPIOPin *in_pin)
 
void set_out_pin (InternalGPIOPin *out_pin)
 
 OPENTHERM_SENSOR_LIST (OPENTHERM_SET_SENSOR,) OPENTHERM_BINARY_SENSOR_LIST(OPENTHERM_SET_BINARY_SENSOR
 
 OPENTHERM_SWITCH_LIST (OPENTHERM_SET_SWITCH,) OPENTHERM_NUMBER_LIST(OPENTHERM_SET_NUMBER
 
 OPENTHERM_OUTPUT_LIST (OPENTHERM_SET_OUTPUT,) OPENTHERM_INPUT_SENSOR_LIST(OPENTHERM_SET_INPUT_SENSOR
 
void add_initial_message (MessageId message_id)
 
void add_repeating_message (MessageId message_id)
 
void set_ch_enable (bool value)
 
void set_dhw_enable (bool value)
 
void set_cooling_enable (bool value)
 
void set_otc_active (bool value)
 
void set_ch2_active (bool value)
 
void set_summer_mode_active (bool value)
 
void set_dhw_block (bool value)
 
void set_sync_mode (bool sync_mode)
 
void set_opentherm_version (float value)
 
float get_setup_priority () const override
 
void setup () override
 
void on_shutdown () override
 
void loop () override
 
void dump_config () override
 
- Public Member Functions inherited from esphome::Component
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_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...
 

Data Fields

bool ch_enable = true
 
bool dhw_enable = true
 
bool cooling_enable = false
 
bool otc_active = false
 
bool ch2_active = false
 
bool summer_mode_active = false
 
bool dhw_block = false
 

Protected Member Functions

 OPENTHERM_SENSOR_LIST (OPENTHERM_DECLARE_SENSOR,) OPENTHERM_BINARY_SENSOR_LIST(OPENTHERM_DECLARE_BINARY_SENSOR
 
 OPENTHERM_SWITCH_LIST (OPENTHERM_DECLARE_SWITCH,) OPENTHERM_NUMBER_LIST(OPENTHERM_DECLARE_NUMBER
 
 OPENTHERM_OUTPUT_LIST (OPENTHERM_DECLARE_OUTPUT,) OPENTHERM_INPUT_SENSOR_LIST(OPENTHERM_DECLARE_INPUT_SENSOR
 
OpenthermData build_request_ (MessageId request_id) const
 
void handle_protocol_write_error_ ()
 
void handle_protocol_read_error_ ()
 
void handle_timeout_error_ ()
 
void stop_opentherm_ ()
 
void start_conversation_ ()
 
void read_response_ ()
 
bool check_timings_ (uint32_t cur_time)
 
bool should_skip_loop_ (uint32_t cur_time) const
 
void sync_loop_ ()
 
template<typename F >
bool spin_wait_ (uint32_t timeout, F func)
 
- 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. 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

InternalGPIOPinin_pin_
 
InternalGPIOPinout_pin_
 
std::unique_ptr< OpenThermopentherm_
 
std::vector< MessageIdinitial_messages_
 
std::vector< MessageIdrepeating_messages_
 
bool sending_initial_ = true
 
std::vector< MessageId >::const_iterator current_message_iterator_
 
uint32_t last_conversation_start_ = 0
 
uint32_t last_conversation_end_ = 0
 
OperationMode last_mode_ = IDLE
 
OpenthermData last_request_
 
bool sync_mode_ = false
 
float opentherm_version_ = 0.0f
 
- 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}
 

Detailed Description

Definition at line 42 of file hub.h.

Constructor & Destructor Documentation

◆ OpenthermHub()

esphome::opentherm::OpenthermHub::OpenthermHub ( )

Definition at line 136 of file hub.cpp.

Member Function Documentation

◆ add_initial_message()

void esphome::opentherm::OpenthermHub::add_initial_message ( MessageId  message_id)
inline

Definition at line 131 of file hub.h.

◆ add_repeating_message()

void esphome::opentherm::OpenthermHub::add_repeating_message ( MessageId  message_id)
inline

Definition at line 136 of file hub.h.

◆ build_request_()

OpenthermData esphome::opentherm::OpenthermHub::build_request_ ( MessageId  request_id) const
protected

Definition at line 63 of file hub.cpp.

◆ check_timings_()

bool esphome::opentherm::OpenthermHub::check_timings_ ( uint32_t  cur_time)
protected

Definition at line 284 of file hub.cpp.

◆ dump_config()

void esphome::opentherm::OpenthermHub::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 360 of file hub.cpp.

◆ get_setup_priority()

float esphome::opentherm::OpenthermHub::get_setup_priority ( ) const
inlineoverridevirtual

Reimplemented from esphome::Component.

Definition at line 154 of file hub.h.

◆ handle_protocol_read_error_()

void esphome::opentherm::OpenthermHub::handle_protocol_read_error_ ( )
protected

Definition at line 348 of file hub.cpp.

◆ handle_protocol_write_error_()

void esphome::opentherm::OpenthermHub::handle_protocol_write_error_ ( )
protected

Definition at line 343 of file hub.cpp.

◆ handle_timeout_error_()

void esphome::opentherm::OpenthermHub::handle_timeout_error_ ( )
protected

Definition at line 355 of file hub.cpp.

◆ loop()

void esphome::opentherm::OpenthermHub::loop ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 179 of file hub.cpp.

◆ on_shutdown()

void esphome::opentherm::OpenthermHub::on_shutdown ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 177 of file hub.cpp.

◆ OPENTHERM_OUTPUT_LIST() [1/2]

esphome::opentherm::OpenthermHub::OPENTHERM_OUTPUT_LIST ( OPENTHERM_DECLARE_OUTPUT  )
protected

◆ OPENTHERM_OUTPUT_LIST() [2/2]

esphome::opentherm::OpenthermHub::OPENTHERM_OUTPUT_LIST ( OPENTHERM_SET_OUTPUT  )

◆ OPENTHERM_SENSOR_LIST() [1/2]

esphome::opentherm::OpenthermHub::OPENTHERM_SENSOR_LIST ( OPENTHERM_DECLARE_SENSOR  )
protected

◆ OPENTHERM_SENSOR_LIST() [2/2]

esphome::opentherm::OpenthermHub::OPENTHERM_SENSOR_LIST ( OPENTHERM_SET_SENSOR  )

◆ OPENTHERM_SWITCH_LIST() [1/2]

esphome::opentherm::OpenthermHub::OPENTHERM_SWITCH_LIST ( OPENTHERM_DECLARE_SWITCH  )
protected

◆ OPENTHERM_SWITCH_LIST() [2/2]

esphome::opentherm::OpenthermHub::OPENTHERM_SWITCH_LIST ( OPENTHERM_SET_SWITCH  )

◆ process_response()

void esphome::opentherm::OpenthermHub::process_response ( OpenthermData data)

Definition at line 138 of file hub.cpp.

◆ read_response_()

void esphome::opentherm::OpenthermHub::read_response_ ( )
protected

Definition at line 324 of file hub.cpp.

◆ set_ch2_active()

void esphome::opentherm::OpenthermHub::set_ch2_active ( bool  value)
inline

Definition at line 148 of file hub.h.

◆ set_ch_enable()

void esphome::opentherm::OpenthermHub::set_ch_enable ( bool  value)
inline

Definition at line 144 of file hub.h.

◆ set_cooling_enable()

void esphome::opentherm::OpenthermHub::set_cooling_enable ( bool  value)
inline

Definition at line 146 of file hub.h.

◆ set_dhw_block()

void esphome::opentherm::OpenthermHub::set_dhw_block ( bool  value)
inline

Definition at line 150 of file hub.h.

◆ set_dhw_enable()

void esphome::opentherm::OpenthermHub::set_dhw_enable ( bool  value)
inline

Definition at line 145 of file hub.h.

◆ set_in_pin()

void esphome::opentherm::OpenthermHub::set_in_pin ( InternalGPIOPin in_pin)
inline

Definition at line 115 of file hub.h.

◆ set_opentherm_version()

void esphome::opentherm::OpenthermHub::set_opentherm_version ( float  value)
inline

Definition at line 152 of file hub.h.

◆ set_otc_active()

void esphome::opentherm::OpenthermHub::set_otc_active ( bool  value)
inline

Definition at line 147 of file hub.h.

◆ set_out_pin()

void esphome::opentherm::OpenthermHub::set_out_pin ( InternalGPIOPin out_pin)
inline

Definition at line 116 of file hub.h.

◆ set_summer_mode_active()

void esphome::opentherm::OpenthermHub::set_summer_mode_active ( bool  value)
inline

Definition at line 149 of file hub.h.

◆ set_sync_mode()

void esphome::opentherm::OpenthermHub::set_sync_mode ( bool  sync_mode)
inline

Definition at line 151 of file hub.h.

◆ setup()

void esphome::opentherm::OpenthermHub::setup ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 153 of file hub.cpp.

◆ should_skip_loop_()

bool esphome::opentherm::OpenthermHub::should_skip_loop_ ( uint32_t  cur_time) const
protected

Definition at line 297 of file hub.cpp.

◆ spin_wait_()

template<typename F >
bool esphome::opentherm::OpenthermHub::spin_wait_ ( uint32_t  timeout,
func 
)
inlineprotected

Definition at line 95 of file hub.h.

◆ start_conversation_()

void esphome::opentherm::OpenthermHub::start_conversation_ ( )
protected

Definition at line 306 of file hub.cpp.

◆ stop_opentherm_()

void esphome::opentherm::OpenthermHub::stop_opentherm_ ( )
protected

Definition at line 339 of file hub.cpp.

◆ sync_loop_()

void esphome::opentherm::OpenthermHub::sync_loop_ ( )
protected

Definition at line 225 of file hub.cpp.

Field Documentation

◆ ch2_active

bool esphome::opentherm::OpenthermHub::ch2_active = false

Definition at line 140 of file hub.h.

◆ ch_enable

bool esphome::opentherm::OpenthermHub::ch_enable = true

Definition at line 140 of file hub.h.

◆ cooling_enable

bool esphome::opentherm::OpenthermHub::cooling_enable = false

Definition at line 140 of file hub.h.

◆ current_message_iterator_

std::vector<MessageId>::const_iterator esphome::opentherm::OpenthermHub::current_message_iterator_
protected

Definition at line 69 of file hub.h.

◆ dhw_block

bool esphome::opentherm::OpenthermHub::dhw_block = false

Definition at line 141 of file hub.h.

◆ dhw_enable

bool esphome::opentherm::OpenthermHub::dhw_enable = true

Definition at line 140 of file hub.h.

◆ in_pin_

InternalGPIOPin* esphome::opentherm::OpenthermHub::in_pin_
protected

Definition at line 45 of file hub.h.

◆ initial_messages_

std::vector<MessageId> esphome::opentherm::OpenthermHub::initial_messages_
protected

Definition at line 62 of file hub.h.

◆ last_conversation_end_

uint32_t esphome::opentherm::OpenthermHub::last_conversation_end_ = 0
protected

Definition at line 72 of file hub.h.

◆ last_conversation_start_

uint32_t esphome::opentherm::OpenthermHub::last_conversation_start_ = 0
protected

Definition at line 71 of file hub.h.

◆ last_mode_

OperationMode esphome::opentherm::OpenthermHub::last_mode_ = IDLE
protected

Definition at line 73 of file hub.h.

◆ last_request_

OpenthermData esphome::opentherm::OpenthermHub::last_request_
protected

Definition at line 74 of file hub.h.

◆ opentherm_

std::unique_ptr<OpenTherm> esphome::opentherm::OpenthermHub::opentherm_
protected

Definition at line 47 of file hub.h.

◆ opentherm_version_

float esphome::opentherm::OpenthermHub::opentherm_version_ = 0.0f
protected

Definition at line 81 of file hub.h.

◆ otc_active

bool esphome::opentherm::OpenthermHub::otc_active = false

Definition at line 140 of file hub.h.

◆ out_pin_

InternalGPIOPin * esphome::opentherm::OpenthermHub::out_pin_
protected

Definition at line 45 of file hub.h.

◆ repeating_messages_

std::vector<MessageId> esphome::opentherm::OpenthermHub::repeating_messages_
protected

Definition at line 65 of file hub.h.

◆ sending_initial_

bool esphome::opentherm::OpenthermHub::sending_initial_ = true
protected

Definition at line 67 of file hub.h.

◆ summer_mode_active

bool esphome::opentherm::OpenthermHub::summer_mode_active = false

Definition at line 141 of file hub.h.

◆ sync_mode_

bool esphome::opentherm::OpenthermHub::sync_mode_ = false
protected

Definition at line 79 of file hub.h.


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