11 static void set_sensor(Sensor *
sensor,
float value) {
12 if (sensor !=
nullptr && (!sensor->has_state() || sensor->get_raw_state() != value))
13 sensor->publish_state(value);
16 template<
typename T>
void update_property(T &property,
const T &value,
bool &flag) {
17 if (property != value) {
24 bool need_publish =
false;
55 dudanov::midea::ac::Control ctrl{};
72 this->
base_.control(ctrl);
91 if (this->
base_.getAutoconfStatus() == dudanov::midea::AUTOCONF_OK)
107 #ifdef USE_REMOTE_TRANSMITTER 110 if (this->
base_.getAutoconfStatus() == dudanov::midea::AUTOCONF_OK) {
111 this->
base_.getCapabilities().dump();
112 }
else if (this->
base_.getAutoconfStatus() == dudanov::midea::AUTOCONF_ERROR) {
114 "Failed to get 0xB5 capabilities report. Suggest to disable it in config and manually set your " 115 "appliance options.");
123 #ifdef USE_REMOTE_TRANSMITTER 124 IrFollowMeData data(static_cast<uint8_t>(lroundf(temperature)), beeper);
127 ESP_LOGW(
Constants::TAG,
"Action needs remote_transmitter component");
132 #ifdef USE_REMOTE_TRANSMITTER 136 ESP_LOGW(
Constants::TAG,
"Action needs remote_transmitter component");
141 if (this->
base_.getCapabilities().supportLightControl()) {
142 this->
base_.displayToggle();
144 #ifdef USE_REMOTE_TRANSMITTER 148 ESP_LOGW(
Constants::TAG,
"Action needs remote_transmitter component");
157 #endif // USE_ARDUINO This class is used to encode all control actions on a climate device.
value_type const & value() const
ClimateSwingMode swing_mode
The active swing mode of the climate device.
static ClimateFanMode to_climate_fan_mode(MideaFanMode fan_mode)
static const char *const TAG
void set_supported_custom_presets(std::set< std::string > supported_custom_presets)
void set_visual_temperature_step(float temperature_step)
void on_status_change() override
std::set< std::string > supported_custom_presets_
const std::set< ClimateSwingMode > & get_supported_swing_modes() const
float target_temperature
The target temperature of the climate device.
static const std::string & to_custom_climate_fan_mode(MideaFanMode fan_mode)
dudanov::midea::ac::AirConditioner base_
const optional< ClimateMode > & get_mode() const
This class contains all static data for climate devices.
static bool is_custom_midea_fan_mode(MideaFanMode fan_mode)
void set_visual_min_temperature(float visual_min_temperature)
void do_follow_me(float temperature, bool beeper=false)
ClimateMode mode
The active mode of the climate device.
static void to_climate_traits(ClimateTraits &traits, const dudanov::midea::ac::Capabilities &capabilities)
float current_temperature
The current temperature of the climate device, as reported from the integration.
void set_supported_presets(std::set< ClimatePreset > presets)
std::set< ClimateSwingMode > supported_swing_modes_
void add_supported_preset(ClimatePreset preset)
static MideaPreset to_midea_preset(ClimatePreset preset)
std::set< ClimatePreset > supported_presets_
void add_supported_swing_mode(ClimateSwingMode mode)
void transmit(IrData &data)
const optional< std::string > & get_custom_preset() const
const optional< ClimatePreset > & get_preset() const
optional< ClimatePreset > preset
The active preset of the climate device.
static const std::string & to_custom_climate_preset(MideaPreset preset)
const std::set< ClimateMode > & get_supported_modes() const
const std::set< climate::ClimatePreset > & get_supported_presets() const
void set_supported_modes(std::set< ClimateMode > modes)
void control(const ClimateCall &call) override
std::set< std::string > supported_custom_fan_modes_
static bool is_custom_midea_preset(MideaPreset preset)
void set_visual_max_temperature(float visual_max_temperature)
const optional< std::string > & get_custom_fan_mode() const
void add_supported_fan_mode(ClimateFanMode mode)
const optional< float > & get_target_temperature() const
void publish_state()
Publish the state of the climate device, to be called from integrations.
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.
static ClimatePreset to_climate_preset(MideaPreset preset)
static ClimateSwingMode to_climate_swing_mode(MideaSwingMode mode)
std::set< ClimateMode > supported_modes_
static MideaSwingMode to_midea_swing_mode(ClimateSwingMode mode)
optional< ClimateFanMode > fan_mode
The active fan mode of the climate device.
const optional< ClimateFanMode > & get_fan_mode() const
bool set_custom_preset_(const std::string &preset)
Set custom preset. Reset primary preset. Return true if preset has been changed.
ClimateTraits traits() override
void update_property(T &property, const T &value, bool &flag)
static MideaMode to_midea_mode(ClimateMode mode)
const optional< ClimateSwingMode > & get_swing_mode() const
void dump_config() override
Implementation of SPI Controller mode.
void set_supported_swing_modes(std::set< ClimateSwingMode > modes)
void dump_traits_(const char *tag)
static ClimateMode to_climate_mode(MideaMode mode)
void set_supports_current_temperature(bool supports_current_temperature)
void set_supported_custom_fan_modes(std::set< std::string > supported_custom_fan_modes)
bool set_preset_(ClimatePreset preset)
Set preset. Reset custom preset. Return true if preset has been changed.
void add_supported_mode(ClimateMode mode)
esphome::sensor::Sensor * sensor
bool set_fan_mode_(ClimateFanMode mode)
Set fan mode. Reset custom fan mode. Return true if fan mode has been changed.
Sensor * humidity_sensor_
IrTransmitter transmitter_
static MideaFanMode to_midea_fan_mode(ClimateFanMode fan_mode)