7 #ifdef USE_BINARY_SENSOR 10 #ifdef USE_TEXT_SENSOR 43 OUTDOOR_TEMPERATURE = 0,
46 INDOOR_COIL_TEMPERATURE,
47 OUTDOOR_COIL_TEMPERATURE,
48 OUTDOOR_DEFROST_TEMPERATURE,
49 OUTDOOR_IN_AIR_TEMPERATURE,
50 OUTDOOR_OUT_AIR_TEMPERATURE,
54 EXPANSION_VALVE_OPEN_DEGREE,
55 SUB_SENSOR_TYPE_COUNT,
56 BIG_DATA_FRAME_SUB_SENSORS = INDOOR_COIL_TEMPERATURE,
62 sensor::Sensor *sub_sensors_[(size_t) SubSensorType::SUB_SENSOR_TYPE_COUNT]{
nullptr};
64 #ifdef USE_BINARY_SENSOR 67 OUTDOOR_FAN_STATUS = 0,
71 FOUR_WAY_VALVE_STATUS,
72 INDOOR_ELECTRIC_HEATING_STATUS,
73 SUB_BINARY_SENSOR_TYPE_COUNT,
81 #ifdef USE_TEXT_SENSOR 87 SUB_TEXT_SENSOR_TYPE_COUNT,
109 void dump_config()
override;
110 void set_beeper_state(
bool state);
111 bool get_beeper_state()
const;
112 void set_quiet_mode_state(
bool state);
113 bool get_quiet_mode_state()
const;
118 std::string get_cleaning_status_text()
const;
120 void start_self_cleaning();
121 void start_steri_cleaning();
126 void add_alarm_start_callback(std::function<
void(uint8_t,
const char *)> &&callback);
127 void add_alarm_end_callback(std::function<
void(uint8_t,
const char *)> &&callback);
131 void set_handlers()
override;
132 void process_phase(std::chrono::steady_clock::time_point now)
override;
133 haier_protocol::HaierMessage get_control_message()
override;
134 haier_protocol::HaierMessage get_power_message(
bool state)
override;
135 void initialization()
override;
136 bool prepare_pending_action()
override;
137 void process_protocol_reset()
override;
138 bool should_get_big_data_();
141 haier_protocol::HandlerError get_device_version_answer_handler_(haier_protocol::FrameType request_type,
142 haier_protocol::FrameType message_type,
144 haier_protocol::HandlerError get_device_id_answer_handler_(haier_protocol::FrameType request_type,
145 haier_protocol::FrameType message_type,
146 const uint8_t *data,
size_t data_size);
147 haier_protocol::HandlerError status_handler_(haier_protocol::FrameType request_type,
148 haier_protocol::FrameType message_type,
const uint8_t *data,
150 haier_protocol::HandlerError get_management_information_answer_handler_(haier_protocol::FrameType request_type,
151 haier_protocol::FrameType message_type,
152 const uint8_t *data,
size_t data_size);
153 haier_protocol::HandlerError get_alarm_status_answer_handler_(haier_protocol::FrameType request_type,
154 haier_protocol::FrameType message_type,
155 const uint8_t *data,
size_t data_size);
156 haier_protocol::HandlerError alarm_status_message_handler_(haier_protocol::FrameType type,
const uint8_t *buffer,
159 haier_protocol::HandlerError process_status_message_(
const uint8_t *packet, uint8_t size);
160 void process_alarm_message_(
const uint8_t *packet, uint8_t size,
bool check_new);
161 void fill_control_messages_queue_();
162 void clear_control_messages_queue_();
177 uint8_t active_alarms_[8];
178 int extra_control_packet_bytes_{0};
179 int extra_sensors_packet_bytes_{4};
180 int status_message_header_size_{0};
187 float active_alarm_count_{NAN};
189 int big_data_sensors_{0};
201 [
this](uint8_t alarm_code,
const char *alarm_message) { this->trigger(alarm_code, alarm_message); });
209 [
this](uint8_t alarm_code,
const char *alarm_message) { this->trigger(alarm_code, alarm_message); });
Base class for all switches.
hon_protocol::HorizontalSwingMode last_horizontal_swing
void add_alarm_end_callback(std::function< void(uint8_t, const char *)> &&callback)
bool got_valid_outdoor_temp_
CleaningState cleaning_status_
HonControlMethod control_method_
void set_control_method(HonControlMethod method)
void set_status_message_header_size(size_t size)
void add_alarm_start_callback(std::function< void(uint8_t, const char *)> &&callback)
void set_extra_sensors_packet_bytes_size(size_t size)
ESPPreferenceObject hon_rtc_
void set_extra_control_packet_bytes_size(size_t size)
std::chrono::steady_clock::time_point last_alarm_request_
std::string hardware_version_
float get_active_alarm_count() const
Implementation of SPI Controller mode.
Base class for all binary_sensor-type classes.
HaierAlarmStartTrigger(HonClimate *parent)
Base-class for all sensors.
std::string software_version_
std::queue< haier_protocol::HaierMessage > control_messages_queue_
std::string protocol_version_
hon_protocol::VerticalSwingMode last_vertiacal_swing
HaierAlarmEndTrigger(HonClimate *parent)