ESPHome
2024.12.2
|
#include <haier_base.h>
Data Structures | |
struct | HvacSettings |
struct | PendingAction |
Public Member Functions | |
void | set_display_switch (switch_::Switch *sw) |
void | set_health_mode_switch (switch_::Switch *sw) |
HaierClimateBase () | |
HaierClimateBase (const HaierClimateBase &)=delete | |
HaierClimateBase & | operator= (const HaierClimateBase &)=delete |
~HaierClimateBase () | |
void | setup () override |
void | loop () override |
void | control (const esphome::climate::ClimateCall &call) override |
void | dump_config () override |
float | get_setup_priority () const override |
void | set_display_state (bool state) |
bool | get_display_state () const |
void | set_health_mode (bool state) |
bool | get_health_mode () const |
void | send_power_on_command () |
void | send_power_off_command () |
void | toggle_power () |
void | reset_protocol () |
void | set_supported_modes (const std::set< esphome::climate::ClimateMode > &modes) |
void | set_supported_swing_modes (const std::set< esphome::climate::ClimateSwingMode > &modes) |
void | set_supported_presets (const std::set< esphome::climate::ClimatePreset > &presets) |
bool | valid_connection () const |
size_t | available () noexcept override |
size_t | read_array (uint8_t *data, size_t len) noexcept override |
void | write_array (const uint8_t *data, size_t len) noexcept override |
bool | can_send_message () const |
void | set_answer_timeout (uint32_t timeout) |
void | set_send_wifi (bool send_wifi) |
void | send_custom_command (const haier_protocol::HaierMessage &message) |
void | add_status_message_callback (std::function< void(const char *, size_t)> &&callback) |
Public Member Functions inherited from esphome::Component | |
float | get_actual_setup_priority () const |
void | set_setup_priority (float priority) |
virtual float | get_loop_priority () const |
priority of loop(). More... | |
void | call () |
virtual void | on_shutdown () |
virtual void | on_safe_shutdown () |
uint32_t | get_component_state () const |
virtual void | mark_failed () |
Mark this component as failed. More... | |
bool | is_failed () const |
bool | is_ready () const |
virtual bool | can_proceed () |
bool | status_has_warning () const |
bool | status_has_error () const |
void | status_set_warning (const char *message="unspecified") |
void | status_set_error (const char *message="unspecified") |
void | status_clear_warning () |
void | status_clear_error () |
void | status_momentary_warning (const std::string &name, uint32_t length=5000) |
void | status_momentary_error (const std::string &name, uint32_t length=5000) |
bool | has_overridden_loop () const |
void | set_component_source (const char *source) |
Set where this component was loaded from for some debug messages. More... | |
const char * | get_component_source () const |
Get the integration where this component was declared as a string. More... | |
Public Member Functions inherited from esphome::climate::Climate | |
Climate () | |
void | add_on_state_callback (std::function< void(Climate &)> &&callback) |
Add a callback for the climate device state, each time the state of the climate device is updated (using publish_state), this callback will be called. More... | |
void | add_on_control_callback (std::function< void(ClimateCall &)> &&callback) |
Add a callback for the climate device configuration; each time the configuration parameters of a climate device is updated (using perform() of a ClimateCall), this callback will be called, before any on_state callback. More... | |
ClimateCall | make_call () |
Make a climate device control call, this is used to control the climate device, see the ClimateCall description for more info. More... | |
void | publish_state () |
Publish the state of the climate device, to be called from integrations. More... | |
ClimateTraits | get_traits () |
Get the traits of this climate device with all overrides applied. More... | |
void | set_visual_min_temperature_override (float visual_min_temperature_override) |
void | set_visual_max_temperature_override (float visual_max_temperature_override) |
void | set_visual_temperature_step_override (float target, float current) |
void | set_visual_min_humidity_override (float visual_min_humidity_override) |
void | set_visual_max_humidity_override (float visual_max_humidity_override) |
Public Member Functions inherited from esphome::EntityBase | |
const StringRef & | get_name () const |
void | set_name (const char *name) |
bool | has_own_name () const |
std::string | get_object_id () const |
void | set_object_id (const char *object_id) |
uint32_t | get_object_id_hash () |
bool | is_internal () const |
void | set_internal (bool internal) |
bool | is_disabled_by_default () const |
void | set_disabled_by_default (bool disabled_by_default) |
EntityCategory | get_entity_category () const |
void | set_entity_category (EntityCategory entity_category) |
std::string | get_icon () const |
void | set_icon (const char *icon) |
Public Member Functions inherited from esphome::uart::UARTDevice | |
UARTDevice ()=default | |
UARTDevice (UARTComponent *parent) | |
void | set_uart_parent (UARTComponent *parent) |
void | write_byte (uint8_t data) |
void | write_array (const uint8_t *data, size_t len) |
void | write_array (const std::vector< uint8_t > &data) |
template<size_t N> | |
void | write_array (const std::array< uint8_t, N > &data) |
void | write_str (const char *str) |
bool | read_byte (uint8_t *data) |
bool | peek_byte (uint8_t *data) |
bool | read_array (uint8_t *data, size_t len) |
template<size_t N> | |
optional< std::array< uint8_t, N > > | read_array () |
int | available () |
void | flush () |
int | read () |
size_t | write (uint8_t data) |
int | peek () |
void | check_uart_settings (uint32_t baud_rate, uint8_t stop_bits=1, UARTParityOptions parity=UART_CONFIG_PARITY_NONE, uint8_t data_bits=8) |
Check that the configuration of the UART bus matches the provided values and otherwise print a warning. More... | |
Protected Member Functions | |
const char * | phase_to_string_ (ProtocolPhases phase) |
virtual void | set_handlers ()=0 |
virtual void | process_phase (std::chrono::steady_clock::time_point now)=0 |
virtual haier_protocol::HaierMessage | get_control_message ()=0 |
virtual haier_protocol::HaierMessage | get_power_message (bool state)=0 |
virtual void | save_settings () |
virtual void | initialization () |
virtual bool | prepare_pending_action () |
virtual void | process_protocol_reset () |
esphome::climate::ClimateTraits | traits () override |
haier_protocol::HandlerError | answer_preprocess_ (haier_protocol::FrameType request_message_type, haier_protocol::FrameType expected_request_message_type, haier_protocol::FrameType answer_message_type, haier_protocol::FrameType expected_answer_message_type, ProtocolPhases expected_phase) |
haier_protocol::HandlerError | report_network_status_answer_handler_ (haier_protocol::FrameType request_type, haier_protocol::FrameType message_type, const uint8_t *data, size_t data_size) |
haier_protocol::HandlerError | timeout_default_handler_ (haier_protocol::FrameType request_type) |
void | send_message_ (const haier_protocol::HaierMessage &command, bool use_crc, uint8_t num_repeats=0, std::chrono::milliseconds interval=std::chrono::milliseconds::zero()) |
virtual void | set_phase (ProtocolPhases phase) |
void | reset_phase_ () |
void | reset_to_idle_ () |
bool | is_message_interval_exceeded_ (std::chrono::steady_clock::time_point now) |
bool | is_status_request_interval_exceeded_ (std::chrono::steady_clock::time_point now) |
bool | is_control_message_interval_exceeded_ (std::chrono::steady_clock::time_point now) |
bool | is_protocol_initialisation_interval_exceeded_ (std::chrono::steady_clock::time_point now) |
haier_protocol::HaierMessage | get_wifi_signal_message_ () |
Protected Member Functions inherited from esphome::Component | |
virtual void | call_loop () |
virtual void | call_setup () |
virtual void | call_dump_config () |
void | set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f) |
Set an interval function with a unique name. More... | |
void | set_interval (uint32_t interval, std::function< void()> &&f) |
bool | cancel_interval (const std::string &name) |
Cancel an interval function. More... | |
void | set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f) |
Set an retry function with a unique name. More... | |
void | set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f) |
bool | cancel_retry (const std::string &name) |
Cancel a retry function. More... | |
void | set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f) |
Set a timeout function with a unique name. More... | |
void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
bool | cancel_timeout (const std::string &name) |
Cancel a timeout function. More... | |
void | defer (const std::string &name, std::function< void()> &&f) |
Defer a callback to the next loop() call. More... | |
void | defer (std::function< void()> &&f) |
Defer a callback to the next loop() call. More... | |
bool | cancel_defer (const std::string &name) |
Cancel a defer callback using the specified name, name must not be empty. More... | |
Protected Member Functions inherited from esphome::climate::Climate | |
bool | set_fan_mode_ (ClimateFanMode mode) |
Set fan mode. Reset custom fan mode. Return true if fan mode has been changed. More... | |
bool | set_custom_fan_mode_ (const std::string &mode) |
Set custom fan mode. Reset primary fan mode. Return true if fan mode has been changed. More... | |
bool | set_preset_ (ClimatePreset preset) |
Set preset. Reset custom preset. Return true if preset has been changed. More... | |
bool | set_custom_preset_ (const std::string &preset) |
Set custom preset. Reset primary preset. Return true if preset has been changed. More... | |
optional< ClimateDeviceRestoreState > | restore_state_ () |
Restore the state of the climate device, call this from your setup() method. More... | |
void | save_state_ () |
Internal method to save the state of the climate device to recover memory. More... | |
void | dump_traits_ (const char *tag) |
Protected Member Functions inherited from esphome::EntityBase | |
virtual uint32_t | hash_base () |
The hash_base() function has been deprecated. More... | |
void | calc_object_id_ () |
Additional Inherited Members | |
Data Fields inherited from esphome::climate::Climate | |
ClimateMode | mode {CLIMATE_MODE_OFF} |
The active mode of the climate device. More... | |
ClimateAction | action {CLIMATE_ACTION_OFF} |
The active state of the climate device. More... | |
float | current_temperature {NAN} |
The current temperature of the climate device, as reported from the integration. More... | |
float | current_humidity {NAN} |
The current humidity of the climate device, as reported from the integration. More... | |
union { | |
float target_temperature | |
The target temperature of the climate device. More... | |
struct { | |
float target_temperature_low {NAN} | |
The minimum target temperature of the climate device, for climate devices with split target temperature. More... | |
float target_temperature_high {NAN} | |
The maximum target temperature of the climate device, for climate devices with split target temperature. More... | |
} | |
}; | |
float | target_humidity |
The target humidity of the climate device. More... | |
optional< ClimateFanMode > | fan_mode |
The active fan mode of the climate device. More... | |
ClimateSwingMode | swing_mode |
The active swing mode of the climate device. More... | |
optional< std::string > | custom_fan_mode |
The active custom fan mode of the climate device. More... | |
optional< ClimatePreset > | preset |
The active preset of the climate device. More... | |
optional< std::string > | custom_preset |
The active custom preset mode of the climate device. More... | |
Definition at line 32 of file haier_base.h.
|
strongprotected |
Definition at line 81 of file haier_base.h.
|
strongprotected |
Enumerator | |
---|---|
OFF | |
ON | |
PENDING_OFF | |
PENDING_ON |
Definition at line 149 of file haier_base.h.
esphome::haier::HaierClimateBase::HaierClimateBase | ( | ) |
Definition at line 52 of file haier_base.cpp.
|
delete |
esphome::haier::HaierClimateBase::~HaierClimateBase | ( | ) |
Definition at line 71 of file haier_base.cpp.
void esphome::haier::HaierClimateBase::add_status_message_callback | ( | std::function< void(const char *, size_t)> && | callback | ) |
Definition at line 200 of file haier_base.cpp.
|
protected |
Definition at line 204 of file haier_base.cpp.
|
inlineoverridenoexcept |
Definition at line 67 of file haier_base.h.
|
inline |
Definition at line 74 of file haier_base.h.
|
overridevirtual |
Implements esphome::climate::Climate.
Definition at line 371 of file haier_base.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Reimplemented in esphome::haier::HonClimate, and esphome::haier::Smartair2Climate.
Definition at line 255 of file haier_base.cpp.
|
protectedpure virtual |
Implemented in esphome::haier::HonClimate, and esphome::haier::Smartair2Climate.
bool esphome::haier::HaierClimateBase::get_display_state | ( | ) | const |
Definition at line 135 of file haier_base.cpp.
bool esphome::haier::HaierClimateBase::get_health_mode | ( | ) | const |
Definition at line 147 of file haier_base.cpp.
|
protectedpure virtual |
Implemented in esphome::haier::HonClimate, and esphome::haier::Smartair2Climate.
|
inlineoverridevirtual |
Reimplemented from esphome::Component.
Definition at line 54 of file haier_base.h.
|
protected |
Definition at line 111 of file haier_base.cpp.
|
protectedvirtual |
Reimplemented in esphome::haier::HonClimate.
Definition at line 351 of file haier_base.cpp.
|
protected |
Definition at line 102 of file haier_base.cpp.
|
protected |
Definition at line 94 of file haier_base.cpp.
|
protected |
Definition at line 106 of file haier_base.cpp.
|
protected |
Definition at line 98 of file haier_base.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 260 of file haier_base.cpp.
|
delete |
|
protected |
Definition at line 23 of file haier_base.cpp.
|
protectedvirtual |
Reimplemented in esphome::haier::HonClimate.
Definition at line 326 of file haier_base.cpp.
|
protectedpure virtual |
Implemented in esphome::haier::HonClimate, and esphome::haier::Smartair2Climate.
|
protectedvirtual |
Reimplemented in esphome::haier::HonClimate.
Definition at line 311 of file haier_base.cpp.
|
inlineoverridenoexcept |
Definition at line 68 of file haier_base.h.
|
protected |
Definition at line 223 of file haier_base.cpp.
|
protected |
Definition at line 80 of file haier_base.cpp.
|
inline |
Definition at line 62 of file haier_base.h.
|
protected |
Definition at line 85 of file haier_base.cpp.
|
protectedvirtual |
Definition at line 128 of file haier_base.cpp.
void esphome::haier::HaierClimateBase::send_custom_command | ( | const haier_protocol::HaierMessage & | message | ) |
Definition at line 196 of file haier_base.cpp.
|
protected |
Definition at line 420 of file haier_base.cpp.
void esphome::haier::HaierClimateBase::send_power_off_command | ( | ) |
Definition at line 164 of file haier_base.cpp.
void esphome::haier::HaierClimateBase::send_power_on_command | ( | ) |
Definition at line 159 of file haier_base.cpp.
void esphome::haier::HaierClimateBase::set_answer_timeout | ( | uint32_t | timeout | ) |
Definition at line 180 of file haier_base.cpp.
void esphome::haier::HaierClimateBase::set_display_state | ( | bool | state | ) |
Definition at line 139 of file haier_base.cpp.
void esphome::haier::HaierClimateBase::set_display_switch | ( | switch_::Switch * | sw | ) |
Definition at line 396 of file haier_base.cpp.
|
protectedpure virtual |
Implemented in esphome::haier::HonClimate, and esphome::haier::Smartair2Climate.
void esphome::haier::HaierClimateBase::set_health_mode | ( | bool | state | ) |
Definition at line 151 of file haier_base.cpp.
void esphome::haier::HaierClimateBase::set_health_mode_switch | ( | switch_::Switch * | sw | ) |
Definition at line 403 of file haier_base.cpp.
|
protectedvirtual |
Definition at line 73 of file haier_base.cpp.
void esphome::haier::HaierClimateBase::set_send_wifi | ( | bool | send_wifi | ) |
Definition at line 194 of file haier_base.cpp.
void esphome::haier::HaierClimateBase::set_supported_modes | ( | const std::set< esphome::climate::ClimateMode > & | modes | ) |
Definition at line 182 of file haier_base.cpp.
void esphome::haier::HaierClimateBase::set_supported_presets | ( | const std::set< esphome::climate::ClimatePreset > & | presets | ) |
Definition at line 188 of file haier_base.cpp.
void esphome::haier::HaierClimateBase::set_supported_swing_modes | ( | const std::set< esphome::climate::ClimateSwingMode > & | modes | ) |
Definition at line 174 of file haier_base.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 244 of file haier_base.cpp.
|
protected |
Definition at line 233 of file haier_base.cpp.
void esphome::haier::HaierClimateBase::toggle_power | ( | ) |
Definition at line 169 of file haier_base.cpp.
|
overrideprotectedvirtual |
Implements esphome::climate::Climate.
Definition at line 349 of file haier_base.cpp.
|
inline |
Definition at line 66 of file haier_base.h.
|
inlineoverridenoexcept |
Definition at line 71 of file haier_base.h.
|
protected |
Definition at line 157 of file haier_base.h.
|
protected |
Definition at line 176 of file haier_base.h.
|
protected |
Definition at line 168 of file haier_base.h.
|
protected |
Definition at line 160 of file haier_base.h.
|
protected |
Definition at line 42 of file haier_base.h.
|
protected |
Definition at line 158 of file haier_base.h.
|
protected |
Definition at line 162 of file haier_base.h.
|
protected |
Definition at line 163 of file haier_base.h.
|
protected |
Definition at line 155 of file haier_base.h.
|
protected |
Definition at line 161 of file haier_base.h.
|
protected |
Definition at line 43 of file haier_base.h.
|
protected |
Definition at line 171 of file haier_base.h.
|
protected |
Definition at line 174 of file haier_base.h.
|
protected |
Definition at line 170 of file haier_base.h.
|
protected |
Definition at line 173 of file haier_base.h.
|
protected |
Definition at line 172 of file haier_base.h.
|
protected |
Definition at line 169 of file haier_base.h.
|
protected |
Definition at line 159 of file haier_base.h.
|
protected |
Definition at line 156 of file haier_base.h.
|
protected |
Definition at line 164 of file haier_base.h.
|
protected |
Definition at line 165 of file haier_base.h.
|
protected |
Definition at line 175 of file haier_base.h.
|
protected |
Definition at line 167 of file haier_base.h.
|
protected |
Definition at line 166 of file haier_base.h.