Go to the documentation of this file.
22 #define __STDC_LIMIT_MACROS
30 #include "IRsend_test.h"
80 #define MIDEA_AC_COOL kMideaACCool
81 #define MIDEA_AC_DRY kMideaACDry
82 #define MIDEA_AC_AUTO kMideaACAuto
83 #define MIDEA_AC_HEAT kMideaACHeat
84 #define MIDEA_AC_FAN kMideaACFan
85 #define MIDEA_AC_FAN_AUTO kMideaACFanAuto
86 #define MIDEA_AC_FAN_LOW kMideaACFanLow
87 #define MIDEA_AC_FAN_MED kMideaACFanMed
88 #define MIDEA_AC_FAN_HI kMideaACFanHigh
89 #define MIDEA_AC_POWER kMideaACPower
90 #define MIDEA_AC_SLEEP kMideaACSleep
91 #define MIDEA_AC_MIN_TEMP_F kMideaACMinTempF
92 #define MIDEA_AC_MAX_TEMP_F kMideaACMaxTempF
93 #define MIDEA_AC_MIN_TEMP_C kMideaACMinTempC
94 #define MIDEA_AC_MAX_TEMP_C kMideaACMaxTempC
101 explicit IRMideaAC(
const uint16_t pin,
const bool inverted =
false,
102 const bool use_modulation =
true);
119 void setTemp(
const uint8_t temp,
const bool useCelsius =
false);
120 uint8_t
getTemp(
const bool useCelsius =
false)
const;
121 void setFan(
const uint8_t fan);
122 uint8_t
getFan(
void)
const;
123 void setMode(
const uint8_t mode);
125 void setRaw(
const uint64_t newState);
158 #endif // IR_MIDEA_H_
uint8_t Sum
Definition: ir_Midea.h:41
const uint8_t kMideaACMinTempF
Definition: ir_Midea.h:61
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Midea.cpp:106
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivilant.
Definition: ir_Midea.cpp:358
void setSleep(const bool on)
Set the Sleep setting of the A/C.
Definition: ir_Midea.cpp:240
void on(void)
Set the requested power state of the A/C to on.
Definition: ir_Midea.cpp:136
void setUseCelsius(const bool celsius)
Set the A/C unit to use Celsius natively.
Definition: ir_Midea.cpp:161
const uint16_t kMideaMinRepeat
Definition: IRremoteESP8266.h:950
bool _EconoToggle
Definition: ir_Midea.h:153
MideaProtocol _
Definition: ir_Midea.h:151
void setTemp(const uint8_t temp, const bool useCelsius=false)
Set the temperature.
Definition: ir_Midea.cpp:172
bool getPower(void) const
Get the value of the current power setting.
Definition: ir_Midea.cpp:149
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Midea.h:110
void setEconoToggle(const bool on)
Set the A/C to toggle the Econo (energy saver) mode for the next send.
Definition: ir_Midea.cpp:272
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
bool _SwingVToggle
Definition: ir_Midea.h:152
const uint8_t kMideaACAuto
Definition: ir_Midea.h:67
void checksum(void)
Calculate & set the checksum for the current internal state of the remote.
Definition: ir_Midea.cpp:310
IRMideaAC(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Midea.cpp:93
const uint8_t kMideaACFan
Definition: ir_Midea.h:69
void send(const uint16_t repeat=kMideaMinRepeat)
Send the current internal state as an IR message.
Definition: ir_Midea.cpp:111
uint8_t useFahrenheit
Definition: ir_Midea.h:48
const uint8_t kMideaACMaxTempF
Definition: ir_Midea.h:62
Class for sending all basic IR protocols.
Definition: IRsend.h:176
uint8_t Power
Definition: ir_Midea.h:55
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
void setSwingVToggle(const bool on)
Set the A/C to toggle the vertical swing toggle for the next send.
Definition: ir_Midea.cpp:253
bool isSwingVToggle(void) const
Is the current state a vertical swing toggle message?
Definition: ir_Midea.cpp:258
std::string String
Definition: IRremoteESP8266.h:1128
kSwingVToggleStr
Definition: ir_Midea.h:34
bool getSwingVToggle(void)
Definition: ir_Midea.cpp:265
uint8_t Fan
Definition: ir_Midea.h:52
uint8_t Mode
Definition: ir_Midea.h:51
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Midea.cpp:212
void off(void)
Set the requested power state of the A/C to off.
Definition: ir_Midea.cpp:139
const uint8_t kMideaACHeat
Definition: ir_Midea.h:68
bool getUseCelsius(void) const
Is the device currently using Celsius or the Fahrenheit temp scale?
Definition: ir_Midea.cpp:155
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivilant.
Definition: ir_Midea.cpp:345
const uint8_t kMideaACFanAuto
Definition: ir_Midea.h:70
const uint64_t kMideaACToggleSwingV
Definition: ir_Midea.h:74
IRsend _irsend
Instance of the IR send class.
Definition: ir_Midea.h:145
uint64_t remote_state
The state in native IR code form.
Definition: ir_Midea.h:37
Class for handling detailed Midea A/C messages.
Definition: ir_Midea.h:99
void setRaw(const uint64_t newState)
Set the internal state from a valid code for this protocol.
Definition: ir_Midea.cpp:133
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Midea.cpp:224
static uint8_t calcChecksum(const uint64_t state)
Calculate the checksum for a given state.
Definition: ir_Midea.cpp:290
const PROGMEM char * kIonStr
"Ion"
Definition: IRtext.cpp:55
bool getSleep(void) const
Get the Sleep setting of the A/C.
Definition: ir_Midea.cpp:246
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Midea.cpp:218
const uint64_t kMideaACToggleEcono
Definition: ir_Midea.h:77
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Midea.cpp:331
uint8_t Sleep
Definition: ir_Midea.h:54
const uint8_t kMideaACFanMed
Definition: ir_Midea.h:72
uint64_t getRaw(void)
Get a copy of the internal state/code for this protocol.
Definition: ir_Midea.cpp:126
const uint8_t kMideaACMinTempC
Definition: ir_Midea.h:63
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Midea.cpp:318
const uint8_t kMideaACFanHigh
Definition: ir_Midea.h:73
bool getEconoToggle(void)
Definition: ir_Midea.cpp:282
const uint8_t kMideaACMaxTempC
Definition: ir_Midea.h:64
stdAc::state_t toCommon(const stdAc::state_t *prev=NULL)
Convert the current internal state into its stdAc::state_t equivilant.
Definition: ir_Midea.cpp:370
const uint8_t kMideaACDry
Definition: ir_Midea.h:66
String toString(void)
Convert the current internal state into a human readable string.
Definition: ir_Midea.cpp:407
static bool validChecksum(const uint64_t state)
Verify the checksum is valid for a given state.
Definition: ir_Midea.cpp:305
const uint8_t kMideaACCool
Definition: ir_Midea.h:65
Definition: ir_Midea.h:36
void setPower(const bool on)
Change the power setting.
Definition: ir_Midea.cpp:143
void stateReset(void)
Reset the state of the remote to a known good state/sequence.
Definition: ir_Midea.cpp:98
Structure to hold a common A/C state.
Definition: IRsend.h:97
const uint8_t kMideaACFanLow
Definition: ir_Midea.h:71
uint8_t getTemp(const bool useCelsius=false) const
Get the current temperature setting.
Definition: ir_Midea.cpp:193
uint8_t Temp
Definition: ir_Midea.h:47
void setFan(const uint8_t fan)
Set the speed of the fan.
Definition: ir_Midea.cpp:206
bool isEconoToggle(void) const
Is the current state an Econo (energy saver) toggle message?
Definition: ir_Midea.cpp:276
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46