Go to the documentation of this file.
22 #define __STDC_LIMIT_MACROS
30 #include "IRsend_test.h"
65 #define MIDEA_AC_COOL kMideaACCool
66 #define MIDEA_AC_DRY kMideaACDry
67 #define MIDEA_AC_AUTO kMideaACAuto
68 #define MIDEA_AC_HEAT kMideaACHeat
69 #define MIDEA_AC_FAN kMideaACFan
70 #define MIDEA_AC_FAN_AUTO kMideaACFanAuto
71 #define MIDEA_AC_FAN_LOW kMideaACFanLow
72 #define MIDEA_AC_FAN_MED kMideaACFanMed
73 #define MIDEA_AC_FAN_HI kMideaACFanHigh
74 #define MIDEA_AC_POWER kMideaACPower
75 #define MIDEA_AC_SLEEP kMideaACSleep
76 #define MIDEA_AC_MIN_TEMP_F kMideaACMinTempF
77 #define MIDEA_AC_MAX_TEMP_F kMideaACMaxTempF
78 #define MIDEA_AC_MIN_TEMP_C kMideaACMinTempC
79 #define MIDEA_AC_MAX_TEMP_C kMideaACMaxTempC
86 explicit IRMideaAC(
const uint16_t pin,
const bool inverted =
false,
87 const bool use_modulation =
true);
104 void setTemp(
const uint8_t temp,
const bool useCelsius =
false);
105 uint8_t
getTemp(
const bool useCelsius =
false);
106 void setFan(
const uint8_t fan);
108 void setMode(
const uint8_t mode);
110 void setRaw(
const uint64_t newState);
143 #endif // IR_MIDEA_H_
const uint8_t kMideaACMinTempF
Definition: ir_Midea.h:40
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Midea.cpp:108
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivilant.
Definition: ir_Midea.cpp:362
void setSleep(const bool on)
Set the Sleep setting of the A/C.
Definition: ir_Midea.cpp:244
void on(void)
Set the requested power state of the A/C to on.
Definition: ir_Midea.cpp:139
void setUseCelsius(const bool celsius)
Set the A/C unit to use Celsius natively.
Definition: ir_Midea.cpp:164
const uint16_t kMideaMinRepeat
Definition: IRremoteESP8266.h:931
bool _EconoToggle
Definition: ir_Midea.h:138
void setTemp(const uint8_t temp, const bool useCelsius=false)
Set the temperature.
Definition: ir_Midea.cpp:175
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Midea.h:95
const uint8_t kMideaACTempOffset
Definition: ir_Midea.h:38
void setEconoToggle(const bool on)
Set the A/C to toggle the Econo (energy saver) mode for the next send.
Definition: ir_Midea.cpp:276
const uint8_t kMideaACFanSize
Definition: ir_Midea.h:52
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
uint8_t getFan(void)
Get the current fan speed setting.
Definition: ir_Midea.cpp:216
bool _SwingVToggle
Definition: ir_Midea.h:137
const uint8_t kMideaACAuto
Definition: ir_Midea.h:48
void checksum(void)
Calculate & set the checksum for the current internal state of the remote.
Definition: ir_Midea.cpp:314
IRMideaAC(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Midea.cpp:95
const uint8_t kMideaACFan
Definition: ir_Midea.h:50
void send(const uint16_t repeat=kMideaMinRepeat)
Send the current internal state as an IR message.
Definition: ir_Midea.cpp:113
const uint8_t kMideaACModeOffset
Definition: ir_Midea.h:45
bool isSwingVToggle(void)
Is the current state a vertical swing toggle message?
Definition: ir_Midea.cpp:262
bool getSleep(void)
Get the Sleep setting of the A/C.
Definition: ir_Midea.cpp:250
const uint8_t kMideaACMaxTempF
Definition: ir_Midea.h:41
const uint8_t kMideaACCelsiusOffset
Definition: ir_Midea.h:44
Class for sending all basic IR protocols.
Definition: IRsend.h:170
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:257
std::string String
Definition: IRremoteESP8266.h:1107
kSwingVToggleStr
Definition: ir_Midea.h:34
bool getSwingVToggle(void)
Definition: ir_Midea.cpp:269
void off(void)
Set the requested power state of the A/C to off.
Definition: ir_Midea.cpp:142
const uint8_t kMideaACHeat
Definition: ir_Midea.h:49
bool getPower(void)
Get the value of the current power setting.
Definition: ir_Midea.cpp:152
uint8_t getMode(void)
Get the operating mode setting of the A/C.
Definition: ir_Midea.cpp:222
bool getUseCelsius(void)
Is the device currently using Celsius or the Fahrenheit temp scale?
Definition: ir_Midea.cpp:158
uint8_t getTemp(const bool useCelsius=false)
Get the current temperature setting.
Definition: ir_Midea.cpp:196
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivilant.
Definition: ir_Midea.cpp:349
const uint8_t kMideaACFanAuto
Definition: ir_Midea.h:53
const uint64_t kMideaACToggleSwingV
Definition: ir_Midea.h:59
IRsend _irsend
Instance of the IR send class.
Definition: ir_Midea.h:130
Class for handling detailed Midea A/C messages.
Definition: ir_Midea.h:84
void setRaw(const uint64_t newState)
Set the internal state from a valid code for this protocol.
Definition: ir_Midea.cpp:136
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Midea.cpp:228
static uint8_t calcChecksum(const uint64_t state)
Calculate the checksum for a given state.
Definition: ir_Midea.cpp:294
const PROGMEM char * kIonStr
"Ion"
Definition: IRtext.cpp:55
const uint8_t kMideaACTempSize
Definition: ir_Midea.h:39
const uint64_t kMideaACToggleEcono
Definition: ir_Midea.h:62
uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Midea.cpp:335
const uint8_t kMideaACSleepOffset
Definition: ir_Midea.h:57
const uint8_t kMideaACFanMed
Definition: ir_Midea.h:55
uint64_t getRaw(void)
Get a copy of the internal state/code for this protocol.
Definition: ir_Midea.cpp:129
const uint8_t kMideaACMinTempC
Definition: ir_Midea.h:42
uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Midea.cpp:322
uint64_t remote_state
The state of the IR remote in IR code form.
Definition: ir_Midea.h:136
const uint8_t kMideaACPowerOffset
Definition: ir_Midea.h:58
bool isEconoToggle(void)
Is the current state an Econo (energy saver) toggle message?
Definition: ir_Midea.cpp:280
const uint8_t kMideaACFanHigh
Definition: ir_Midea.h:56
bool getEconoToggle(void)
Definition: ir_Midea.cpp:286
const uint8_t kMideaACMaxTempC
Definition: ir_Midea.h:43
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:374
const uint8_t kMideaACDry
Definition: ir_Midea.h:47
String toString(void)
Convert the current internal state into a human readable string.
Definition: ir_Midea.cpp:411
static bool validChecksum(const uint64_t state)
Verify the checksum is valid for a given state.
Definition: ir_Midea.cpp:309
const uint8_t kMideaACFanOffset
Definition: ir_Midea.h:51
const uint8_t kMideaACCool
Definition: ir_Midea.h:46
void setPower(const bool on)
Change the power setting.
Definition: ir_Midea.cpp:146
void stateReset(void)
Reset the state of the remote to a known good state/sequence.
Definition: ir_Midea.cpp:100
Structure to hold a common A/C state.
Definition: IRsend.h:97
const uint8_t kMideaACFanLow
Definition: ir_Midea.h:54
void setFan(const uint8_t fan)
Set the speed of the fan.
Definition: ir_Midea.cpp:209
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46