ESPHome  2022.9.1
ac_adapter.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 
9 #include "air_conditioner.h"
10 
11 namespace esphome {
12 namespace midea {
13 namespace ac {
14 
16 using MideaSwingMode = dudanov::midea::ac::SwingMode;
17 using MideaFanMode = dudanov::midea::ac::FanMode;
18 using MideaPreset = dudanov::midea::ac::Preset;
19 
20 class Constants {
21  public:
22  static const char *const TAG;
23  static const std::string FREEZE_PROTECTION;
24  static const std::string SILENT;
25  static const std::string TURBO;
26 };
27 
28 class Converters {
29  public:
30  static MideaMode to_midea_mode(ClimateMode mode);
31  static ClimateMode to_climate_mode(MideaMode mode);
32  static MideaSwingMode to_midea_swing_mode(ClimateSwingMode mode);
33  static ClimateSwingMode to_climate_swing_mode(MideaSwingMode mode);
34  static MideaPreset to_midea_preset(ClimatePreset preset);
35  static MideaPreset to_midea_preset(const std::string &preset);
36  static bool is_custom_midea_preset(MideaPreset preset);
37  static ClimatePreset to_climate_preset(MideaPreset preset);
38  static const std::string &to_custom_climate_preset(MideaPreset preset);
39  static MideaFanMode to_midea_fan_mode(ClimateFanMode fan_mode);
40  static MideaFanMode to_midea_fan_mode(const std::string &fan_mode);
41  static bool is_custom_midea_fan_mode(MideaFanMode fan_mode);
42  static ClimateFanMode to_climate_fan_mode(MideaFanMode fan_mode);
43  static const std::string &to_custom_climate_fan_mode(MideaFanMode fan_mode);
44  static void to_climate_traits(ClimateTraits &traits, const dudanov::midea::ac::Capabilities &capabilities);
45 };
46 
47 } // namespace ac
48 } // namespace midea
49 } // namespace esphome
50 
51 #endif // USE_ARDUINO
static const char *const TAG
Definition: ac_adapter.h:22
This class contains all static data for climate devices.
dudanov::midea::ac::Mode MideaMode
Definition: ac_adapter.h:15
static const std::string TURBO
Definition: ac_adapter.h:25
BedjetMode mode
BedJet operating mode.
Definition: bedjet_codec.h:151
static const std::string FREEZE_PROTECTION
Definition: ac_adapter.h:23
ClimateFanMode fan_mode
Definition: climate.h:540
Definition: a4988.cpp:4
dudanov::midea::ac::SwingMode MideaSwingMode
Definition: ac_adapter.h:16
dudanov::midea::ac::Preset MideaPreset
Definition: ac_adapter.h:18
static const std::string SILENT
Definition: ac_adapter.h:24
ClimatePreset preset
Definition: climate.h:545
dudanov::midea::ac::FanMode MideaFanMode
Definition: ac_adapter.h:17