11 #ifdef OPENTHERM_USE_SENSOR 15 #ifdef OPENTHERM_USE_BINARY_SENSOR 19 #ifdef OPENTHERM_USE_SWITCH 23 #ifdef OPENTHERM_USE_OUTPUT 27 #ifdef OPENTHERM_USE_NUMBER 32 #include <unordered_map> 33 #include <unordered_set> 51 OPENTHERM_BINARY_SENSOR_LIST(OPENTHERM_DECLARE_BINARY_SENSOR, )
55 OPENTHERM_NUMBER_LIST(OPENTHERM_DECLARE_NUMBER, )
59 OPENTHERM_INPUT_SENSOR_LIST(OPENTHERM_DECLARE_INPUT_SENSOR, )
95 template<typename F>
bool spin_wait_(uint32_t timeout, F func) {
96 auto start_time =
millis();
100 if (cur_time - start_time >= timeout) {
120 OPENTHERM_BINARY_SENSOR_LIST(OPENTHERM_SET_BINARY_SENSOR, )
124 OPENTHERM_NUMBER_LIST(OPENTHERM_SET_NUMBER, )
128 OPENTHERM_INPUT_SENSOR_LIST(OPENTHERM_SET_INPUT_SENSOR, )
156 void setup()
override;
158 void loop()
override;
bool should_skip_loop_(uint32_t cur_time) const
void set_dhw_block(bool value)
bool check_timings_(uint32_t cur_time)
void handle_protocol_read_error_()
uint32_t last_conversation_start_
std::vector< MessageId >::const_iterator current_message_iterator_
void process_response(OpenthermData &data)
InternalGPIOPin * in_pin_
OPENTHERM_OUTPUT_LIST(OPENTHERM_DECLARE_OUTPUT,) OPENTHERM_INPUT_SENSOR_LIST(OPENTHERM_DECLARE_INPUT_SENSOR
void set_out_pin(InternalGPIOPin *out_pin)
std::unique_ptr< OpenTherm > opentherm_
void handle_protocol_write_error_()
uint32_t IRAM_ATTR HOT millis()
void set_opentherm_version(float value)
bool spin_wait_(uint32_t timeout, F func)
void set_sync_mode(bool sync_mode)
void start_conversation_()
uint32_t last_conversation_end_
InternalGPIOPin * out_pin_
std::vector< MessageId > initial_messages_
void set_in_pin(InternalGPIOPin *in_pin)
void set_cooling_enable(bool value)
std::vector< MessageId > repeating_messages_
void dump_config() override
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
float get_setup_priority() const override
void add_initial_message(MessageId message_id)
void IRAM_ATTR HOT yield()
void set_dhw_enable(bool value)
void set_otc_active(bool value)
OPENTHERM_SWITCH_LIST(OPENTHERM_DECLARE_SWITCH,) OPENTHERM_NUMBER_LIST(OPENTHERM_DECLARE_NUMBER
Implementation of SPI Controller mode.
void set_ch_enable(bool value)
void add_repeating_message(MessageId message_id)
Structure to hold Opentherm data packet content.
void handle_timeout_error_()
void set_summer_mode_active(bool value)
OPENTHERM_SENSOR_LIST(OPENTHERM_DECLARE_SENSOR,) OPENTHERM_BINARY_SENSOR_LIST(OPENTHERM_DECLARE_BINARY_SENSOR
void on_shutdown() override
OpenthermData build_request_(MessageId request_id) const
void set_ch2_active(bool value)
OpenthermData last_request_