13 #ifndef OPENTHERM_SENSOR_LIST 14 #define OPENTHERM_SENSOR_LIST(F, sep) 16 #ifndef OPENTHERM_BINARY_SENSOR_LIST 17 #define OPENTHERM_BINARY_SENSOR_LIST(F, sep) 19 #ifndef OPENTHERM_SWITCH_LIST 20 #define OPENTHERM_SWITCH_LIST(F, sep) 22 #ifndef OPENTHERM_NUMBER_LIST 23 #define OPENTHERM_NUMBER_LIST(F, sep) 25 #ifndef OPENTHERM_OUTPUT_LIST 26 #define OPENTHERM_OUTPUT_LIST(F, sep) 28 #ifndef OPENTHERM_INPUT_SENSOR_LIST 29 #define OPENTHERM_INPUT_SENSOR_LIST(F, sep) 33 #define OPENTHERM_DECLARE_SENSOR(entity) sensor::Sensor *entity; 34 #define OPENTHERM_DECLARE_BINARY_SENSOR(entity) binary_sensor::BinarySensor *entity; 35 #define OPENTHERM_DECLARE_SWITCH(entity) OpenthermSwitch *entity; 36 #define OPENTHERM_DECLARE_NUMBER(entity) OpenthermNumber *entity; 37 #define OPENTHERM_DECLARE_OUTPUT(entity) OpenthermOutput *entity; 38 #define OPENTHERM_DECLARE_INPUT_SENSOR(entity) sensor::Sensor *entity; 41 #define OPENTHERM_SET_SENSOR(entity) \ 42 void set_##entity(sensor::Sensor *sensor) { this->entity = sensor; } 44 #define OPENTHERM_SET_BINARY_SENSOR(entity) \ 45 void set_##entity(binary_sensor::BinarySensor *binary_sensor) { this->entity = binary_sensor; } 47 #define OPENTHERM_SET_SWITCH(entity) \ 48 void set_##entity(OpenthermSwitch *sw) { this->entity = sw; } 50 #define OPENTHERM_SET_NUMBER(entity) \ 51 void set_##entity(OpenthermNumber *number) { this->entity = number; } 53 #define OPENTHERM_SET_OUTPUT(entity) \ 54 void set_##entity(OpenthermOutput *output) { this->entity = output; } 56 #define OPENTHERM_SET_INPUT_SENSOR(entity) \ 57 void set_##entity(sensor::Sensor *sensor) { this->entity = sensor; } 70 #ifndef OPENTHERM_SENSOR_MESSAGE_HANDLERS 71 #define OPENTHERM_SENSOR_MESSAGE_HANDLERS(MESSAGE, ENTITY, entity_sep, postscript, msg_sep) 73 #ifndef OPENTHERM_BINARY_SENSOR_MESSAGE_HANDLERS 74 #define OPENTHERM_BINARY_SENSOR_MESSAGE_HANDLERS(MESSAGE, ENTITY, entity_sep, postscript, msg_sep) 76 #ifndef OPENTHERM_SWITCH_MESSAGE_HANDLERS 77 #define OPENTHERM_SWITCH_MESSAGE_HANDLERS(MESSAGE, ENTITY, entity_sep, postscript, msg_sep) 79 #ifndef OPENTHERM_NUMBER_MESSAGE_HANDLERS 80 #define OPENTHERM_NUMBER_MESSAGE_HANDLERS(MESSAGE, ENTITY, entity_sep, postscript, msg_sep) 82 #ifndef OPENTHERM_OUTPUT_MESSAGE_HANDLERS 83 #define OPENTHERM_OUTPUT_MESSAGE_HANDLERS(MESSAGE, ENTITY, entity_sep, postscript, msg_sep) 85 #ifndef OPENTHERM_INPUT_SENSOR_MESSAGE_HANDLERS 86 #define OPENTHERM_INPUT_SENSOR_MESSAGE_HANDLERS(MESSAGE, ENTITY, entity_sep, postscript, msg_sep) 90 #define OPENTHERM_MESSAGE_WRITE_MESSAGE(msg) \ 91 case MessageId::msg: { \ 92 data.type = MessageType::WRITE_DATA; \ 94 #define OPENTHERM_MESSAGE_WRITE_ENTITY(key, msg_data) message_data::write_##msg_data(this->key->state, data); 95 #define OPENTHERM_MESSAGE_WRITE_POSTSCRIPT \ 100 #define OPENTHERM_MESSAGE_READ_MESSAGE(msg) \ 101 case MessageId::msg: \ 102 data.type = MessageType::READ_DATA; \ 103 data.id = request_id; \ 107 #define OPENTHERM_MESSAGE_RESPONSE_MESSAGE(msg) case MessageId::msg: 108 #define OPENTHERM_MESSAGE_RESPONSE_ENTITY(key, msg_data) this->key->publish_state(message_data::parse_##msg_data(data)); 109 #define OPENTHERM_MESSAGE_RESPONSE_POSTSCRIPT break; 111 #define OPENTHERM_IGNORE(x, y) 114 #ifndef OPENTHERM_READ_ch_enable 115 #define OPENTHERM_READ_ch_enable true 117 #ifndef OPENTHERM_READ_dhw_enable 118 #define OPENTHERM_READ_dhw_enable true 120 #ifndef OPENTHERM_READ_t_set 121 #define OPENTHERM_READ_t_set 0.0 123 #ifndef OPENTHERM_READ_cooling_enable 124 #define OPENTHERM_READ_cooling_enable false 126 #ifndef OPENTHERM_READ_cooling_control 127 #define OPENTHERM_READ_cooling_control 0.0 129 #ifndef OPENTHERM_READ_otc_active 130 #define OPENTHERM_READ_otc_active false 132 #ifndef OPENTHERM_READ_ch2_active 133 #define OPENTHERM_READ_ch2_active false 135 #ifndef OPENTHERM_READ_t_set_ch2 136 #define OPENTHERM_READ_t_set_ch2 0.0 138 #ifndef OPENTHERM_READ_summer_mode_active 139 #define OPENTHERM_READ_summer_mode_active false 141 #ifndef OPENTHERM_READ_dhw_block 142 #define OPENTHERM_READ_dhw_block false 147 #define SHOW_INNER(x) #x 148 #define SHOW(x) SHOW_INNER(x) Implementation of SPI Controller mode.