8 #include <protocol/haier_protocol.h> 25 public haier_protocol::ProtocolStream {
31 void setup()
override;
34 void dump_config()
override;
36 void set_display_state(
bool state);
37 bool get_display_state()
const;
38 void set_health_mode(
bool state);
39 bool get_health_mode()
const;
40 void send_power_on_command();
41 void send_power_off_command();
44 void set_supported_modes(
const std::set<esphome::climate::ClimateMode> &modes);
45 void set_supported_swing_modes(
const std::set<esphome::climate::ClimateSwingMode> &modes);
46 void set_supported_presets(
const std::set<esphome::climate::ClimatePreset> &presets);
55 bool can_send_message()
const {
return haier_protocol_.get_outgoing_queue_size() == 0; };
56 void set_answer_timeout(uint32_t timeout);
57 void set_send_wifi(
bool send_wifi);
58 void send_custom_command(
const haier_protocol::HaierMessage &message);
66 SENDING_FIRST_STATUS_REQUEST,
67 SENDING_FIRST_ALARM_STATUS_REQUEST,
70 SENDING_STATUS_REQUEST,
71 SENDING_UPDATE_SIGNAL_REQUEST,
74 SENDING_ACTION_COMMAND,
75 SENDING_ALARM_STATUS_REQUEST,
79 virtual void set_handlers() = 0;
80 virtual void process_phase(std::chrono::steady_clock::time_point now) = 0;
81 virtual haier_protocol::HaierMessage get_control_message() = 0;
82 virtual haier_protocol::HaierMessage get_power_message(
bool state) = 0;
83 virtual bool prepare_pending_action();
84 virtual void process_protocol_reset();
87 haier_protocol::HandlerError answer_preprocess_(haier_protocol::FrameType request_message_type,
88 haier_protocol::FrameType expected_request_message_type,
89 haier_protocol::FrameType answer_message_type,
90 haier_protocol::FrameType expected_answer_message_type,
92 haier_protocol::HandlerError report_network_status_answer_handler_(haier_protocol::FrameType request_type,
93 haier_protocol::FrameType message_type,
96 haier_protocol::HandlerError timeout_default_handler_(haier_protocol::FrameType request_type);
98 void send_message_(
const haier_protocol::HaierMessage &command,
bool use_crc, uint8_t num_repeats = 0,
99 std::chrono::milliseconds interval = std::chrono::milliseconds::zero());
102 void reset_to_idle_();
103 bool is_message_interval_exceeded_(std::chrono::steady_clock::time_point now);
104 bool is_status_request_interval_exceeded_(std::chrono::steady_clock::time_point now);
105 bool is_control_message_interval_exceeded_(std::chrono::steady_clock::time_point now);
106 bool is_protocol_initialisation_interval_exceeded_(std::chrono::steady_clock::time_point now);
108 haier_protocol::HaierMessage get_wifi_signal_message_();
HvacSettings current_hvac_settings_
This class is used to encode all control actions on a climate device.
bool can_send_message() const
esphome::optional< float > target_temperature
optional< std::array< uint8_t, N > > read_array()
void write_array(const uint8_t *data, size_t len)
esphome::optional< esphome::climate::ClimatePreset > preset
std::unique_ptr< uint8_t[]> last_status_message_
This class contains all static data for climate devices.
bool reset_protocol_request_
std::chrono::steady_clock::time_point last_status_request_
std::chrono::steady_clock::time_point last_signal_request_
esphome::optional< haier_protocol::HaierMessage > message
void write_array(const uint8_t *data, size_t len) noexcept override
haier_protocol::ProtocolHandler haier_protocol_
size_t available() noexcept override
ProtocolPhases protocol_phase_
esphome::optional< PendingAction > action_request_
esphome::optional< esphome::climate::ClimateFanMode > fan_mode
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
HvacSettings next_hvac_settings_
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
std::chrono::steady_clock::time_point last_request_timestamp_
uint8_t other_modes_fan_speed_
size_t read_array(uint8_t *data, size_t len) noexcept override
float get_setup_priority() const override
esphome::climate::ClimateTraits traits_
bool forced_request_status_
esphome::optional< esphome::climate::ClimateSwingMode > swing_mode
ClimateDevice - This is the base class for all climate integrations.
std::chrono::steady_clock::time_point last_valid_status_timestamp_
esphome::optional< esphome::climate::ClimateMode > mode