ESPHome 2025.12.0-dev
Loading...
Searching...
No Matches
air_conditioner.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_ARDUINO
4
5// MideaUART
6#include <Appliance/AirConditioner/AirConditioner.h>
7
8#include "appliance_base.h"
10
11namespace esphome {
12namespace midea {
13namespace ac {
14
15using sensor::Sensor;
16using climate::ClimateCall;
18using climate::ClimateTraits;
25
26class AirConditioner : public ApplianceBase<dudanov::midea::ac::AirConditioner>, public climate::Climate {
27 public:
28 void dump_config() override;
29 void set_outdoor_temperature_sensor(Sensor *sensor) { this->outdoor_sensor_ = sensor; }
30 void set_humidity_setpoint_sensor(Sensor *sensor) { this->humidity_sensor_ = sensor; }
31 void set_power_sensor(Sensor *sensor) { this->power_sensor_ = sensor; }
32 void on_status_change() override;
33
34 /* ############### */
35 /* ### ACTIONS ### */
36 /* ############### */
37
38 void do_follow_me(float temperature, bool use_fahrenheit, bool beeper = false);
39 void do_display_toggle();
40 void do_swing_step();
41 void do_beeper_on() { this->set_beeper_feedback(true); }
42 void do_beeper_off() { this->set_beeper_feedback(false); }
43 void do_power_on() { this->base_.setPowerState(true); }
44 void do_power_off() { this->base_.setPowerState(false); }
45 void do_power_toggle() { this->base_.setPowerState(this->mode == ClimateMode::CLIMATE_MODE_OFF); }
49 void set_custom_presets(std::initializer_list<const char *> presets) { this->supported_custom_presets_ = presets; }
50 void set_custom_fan_modes(std::initializer_list<const char *> modes) { this->supported_custom_fan_modes_ = modes; }
51
52 protected:
53 void control(const ClimateCall &call) override;
54 ClimateTraits traits() override;
58 std::vector<const char *> supported_custom_presets_{};
59 std::vector<const char *> supported_custom_fan_modes_{};
63};
64
65} // namespace ac
66} // namespace midea
67} // namespace esphome
68
69#endif // USE_ARDUINO
This class is used to encode all control actions on a climate device.
Definition climate.h:33
ClimateDevice - This is the base class for all climate integrations.
Definition climate.h:178
ClimateMode mode
The active mode of the climate device.
Definition climate.h:256
void set_custom_fan_modes(std::initializer_list< const char * > modes)
std::vector< const char * > supported_custom_presets_
void set_custom_presets(std::initializer_list< const char * > presets)
void set_supported_modes(ClimateModeMask modes)
void set_supported_swing_modes(ClimateSwingModeMask modes)
std::vector< const char * > supported_custom_fan_modes_
void set_supported_presets(ClimatePresetMask presets)
void do_follow_me(float temperature, bool use_fahrenheit, bool beeper=false)
void set_humidity_setpoint_sensor(Sensor *sensor)
ClimateSwingModeMask supported_swing_modes_
void set_power_sensor(Sensor *sensor)
void set_outdoor_temperature_sensor(Sensor *sensor)
void control(const ClimateCall &call) override
Base-class for all sensors.
Definition sensor.h:42
FiniteSetMask< ClimateSwingMode, DefaultBitPolicy< ClimateSwingMode, CLIMATE_SWING_HORIZONTAL+1 > > ClimateSwingModeMask
FiniteSetMask< ClimatePreset, DefaultBitPolicy< ClimatePreset, CLIMATE_PRESET_ACTIVITY+1 > > ClimatePresetMask
FiniteSetMask< ClimateMode, DefaultBitPolicy< ClimateMode, CLIMATE_MODE_AUTO+1 > > ClimateModeMask
ClimatePreset
Enum for all preset modes NOTE: If adding values, update ClimatePresetMask in climate_traits....
ClimateSwingMode
Enum for all modes a climate swing can be in NOTE: If adding values, update ClimateSwingModeMask in c...
ClimateMode
Enum for all modes a climate device can be in.
@ CLIMATE_MODE_OFF
The climate device is off.
ClimateFanMode
NOTE: If adding values, update ClimateFanModeMask in climate_traits.h to use the new last value.
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
uint16_t temperature
Definition sun_gtil2.cpp:12