7 #ifdef USE_BINARY_SENSOR 10 #ifdef USE_TEXT_SENSOR 38 OUTDOOR_TEMPERATURE = 0,
41 INDOOR_COIL_TEMPERATURE,
42 OUTDOOR_COIL_TEMPERATURE,
43 OUTDOOR_DEFROST_TEMPERATURE,
44 OUTDOOR_IN_AIR_TEMPERATURE,
45 OUTDOOR_OUT_AIR_TEMPERATURE,
49 EXPANSION_VALVE_OPEN_DEGREE,
50 SUB_SENSOR_TYPE_COUNT,
51 BIG_DATA_FRAME_SUB_SENSORS = INDOOR_COIL_TEMPERATURE,
57 sensor::Sensor *sub_sensors_[(size_t) SubSensorType::SUB_SENSOR_TYPE_COUNT]{
nullptr};
59 #ifdef USE_BINARY_SENSOR 62 OUTDOOR_FAN_STATUS = 0,
66 FOUR_WAY_VALVE_STATUS,
67 INDOOR_ELECTRIC_HEATING_STATUS,
68 SUB_BINARY_SENSOR_TYPE_COUNT,
76 #ifdef USE_TEXT_SENSOR 82 SUB_TEXT_SENSOR_TYPE_COUNT,
95 void dump_config()
override;
96 void set_beeper_state(
bool state);
97 bool get_beeper_state()
const;
102 std::string get_cleaning_status_text()
const;
104 void start_self_cleaning();
105 void start_steri_cleaning();
110 void add_alarm_start_callback(std::function<
void(uint8_t,
const char *)> &&callback);
111 void add_alarm_end_callback(std::function<
void(uint8_t,
const char *)> &&callback);
115 void set_handlers()
override;
116 void process_phase(std::chrono::steady_clock::time_point now)
override;
117 haier_protocol::HaierMessage get_control_message()
override;
118 haier_protocol::HaierMessage get_power_message(
bool state)
override;
119 void initialization()
override;
120 bool prepare_pending_action()
override;
121 void process_protocol_reset()
override;
122 bool should_get_big_data_();
125 haier_protocol::HandlerError get_device_version_answer_handler_(haier_protocol::FrameType request_type,
126 haier_protocol::FrameType message_type,
128 haier_protocol::HandlerError get_device_id_answer_handler_(haier_protocol::FrameType request_type,
129 haier_protocol::FrameType message_type,
130 const uint8_t *data,
size_t data_size);
131 haier_protocol::HandlerError status_handler_(haier_protocol::FrameType request_type,
132 haier_protocol::FrameType message_type,
const uint8_t *data,
134 haier_protocol::HandlerError get_management_information_answer_handler_(haier_protocol::FrameType request_type,
135 haier_protocol::FrameType message_type,
136 const uint8_t *data,
size_t data_size);
137 haier_protocol::HandlerError get_alarm_status_answer_handler_(haier_protocol::FrameType request_type,
138 haier_protocol::FrameType message_type,
139 const uint8_t *data,
size_t data_size);
140 haier_protocol::HandlerError alarm_status_message_handler_(haier_protocol::FrameType type,
const uint8_t *buffer,
143 haier_protocol::HandlerError process_status_message_(
const uint8_t *packet, uint8_t size);
144 void process_alarm_message_(
const uint8_t *packet, uint8_t size,
bool check_new);
145 void fill_control_messages_queue_();
146 void clear_control_messages_queue_();
162 uint8_t active_alarms_[8];
163 int extra_control_packet_bytes_{0};
164 int extra_sensors_packet_bytes_{4};
165 int status_message_header_size_{0};
172 float active_alarm_count_{NAN};
174 int big_data_sensors_{0};
185 [
this](uint8_t alarm_code,
const char *alarm_message) { this->trigger(alarm_code, alarm_message); });
193 [
this](uint8_t alarm_code,
const char *alarm_message) { this->trigger(alarm_code, alarm_message); });
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)
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)