Go to the documentation of this file.
29 #define __STDC_LIMIT_MACROS
37 #include "IRsend_test.h"
132 #define MIDEA_AC_COOL kMideaACCool
133 #define MIDEA_AC_DRY kMideaACDry
134 #define MIDEA_AC_AUTO kMideaACAuto
135 #define MIDEA_AC_HEAT kMideaACHeat
136 #define MIDEA_AC_FAN kMideaACFan
137 #define MIDEA_AC_FAN_AUTO kMideaACFanAuto
138 #define MIDEA_AC_FAN_LOW kMideaACFanLow
139 #define MIDEA_AC_FAN_MED kMideaACFanMed
140 #define MIDEA_AC_FAN_HI kMideaACFanHigh
141 #define MIDEA_AC_POWER kMideaACPower
142 #define MIDEA_AC_SLEEP kMideaACSleep
143 #define MIDEA_AC_MIN_TEMP_F kMideaACMinTempF
144 #define MIDEA_AC_MAX_TEMP_F kMideaACMaxTempF
145 #define MIDEA_AC_MIN_TEMP_C kMideaACMinTempC
146 #define MIDEA_AC_MAX_TEMP_C kMideaACMaxTempC
153 explicit IRMideaAC(
const uint16_t pin,
const bool inverted =
false,
154 const bool use_modulation =
true);
171 void setTemp(
const uint8_t temp,
const bool useCelsius =
false);
172 uint8_t
getTemp(
const bool useCelsius =
false)
const;
173 void setSensorTemp(
const uint8_t temp,
const bool useCelsius =
false);
177 void setFan(
const uint8_t fan);
178 uint8_t
getFan(
void)
const;
179 void setMode(
const uint8_t mode);
181 void setRaw(
const uint64_t newState);
235 void setType(
const uint8_t type);
238 #endif // IR_MIDEA_H_
void setOnTimer(const uint16_t mins)
Set the value of the On Timer.
Definition: ir_Midea.cpp:481
uint8_t getType(void) const
Get the message type setting of the A/C message.
Definition: ir_Midea.cpp:443
uint8_t Sum
Definition: ir_Midea.h:59
const uint8_t kMideaACMinTempF
Fahrenheit.
Definition: ir_Midea.h:93
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Midea.cpp:113
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Midea.cpp:556
void setSleep(const bool on)
Set the Sleep setting of the A/C.
Definition: ir_Midea.cpp:313
void on(void)
Set the requested power state of the A/C to on.
Definition: ir_Midea.cpp:153
void setUseCelsius(const bool celsius)
Set the A/C unit to use Celsius natively.
Definition: ir_Midea.cpp:178
const uint16_t kMideaMinRepeat
Definition: IRremoteESP8266.h:994
bool _EconoToggle
Definition: ir_Midea.h:230
MideaProtocol _
Definition: ir_Midea.h:225
void setTemp(const uint8_t temp, const bool useCelsius=false)
Set the temperature.
Definition: ir_Midea.cpp:189
bool getPower(void) const
Get the value of the current power setting.
Definition: ir_Midea.cpp:166
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Midea.h:162
bool isOffTimerEnabled(void) const
Is the OffTimer enabled?
Definition: ir_Midea.cpp:492
bool _TurboToggle
Definition: ir_Midea.h:231
uint8_t Type
Normal, Special, or FollowMe message type.
Definition: ir_Midea.h:87
const uint8_t kMideaACMaxSensorTempF
Fahrenheit (Guess only!)
Definition: ir_Midea.h:100
const uint8_t kMideaACTypeFollow
Message type.
Definition: ir_Midea.h:129
void setEconoToggle(const bool on)
Set the A/C to toggle the Econo (energy saver) mode for the next send.
Definition: ir_Midea.cpp:364
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
uint8_t Header
Typically 0b10100.
Definition: ir_Midea.h:88
bool _SwingVToggle
Definition: ir_Midea.h:226
const uint8_t kMideaACAuto
Definition: ir_Midea.h:105
void checksum(void)
Calculate & set the checksum for the current internal state of the remote.
Definition: ir_Midea.cpp:436
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:107
bool isOnTimerEnabled(void) const
Is the OnTimer enabled?
Definition: ir_Midea.cpp:463
void send(const uint16_t repeat=kMideaMinRepeat)
Send the current internal state as an IR message.
Definition: ir_Midea.cpp:118
uint8_t useFahrenheit
Definition: ir_Midea.h:76
const uint8_t kMideaACTypeSpecial
Message type.
Definition: ir_Midea.h:128
void setType(const uint8_t type)
Set the message type setting of the A/C message.
Definition: ir_Midea.cpp:447
void setTurboToggle(const bool on)
Set the A/C to toggle the Turbo mode for the next send.
Definition: ir_Midea.cpp:381
const uint8_t kMideaACMaxTempF
Fahrenheit.
Definition: ir_Midea.h:94
bool getLightToggle(void)
Definition: ir_Midea.cpp:408
uint16_t getOffTimer(void) const
Get the value of the OffTimer is currently set to.
Definition: ir_Midea.cpp:498
Class for sending all basic IR protocols.
Definition: IRsend.h:182
uint8_t Power
Definition: ir_Midea.h:85
const uint8_t kMideaACTimerOff
Definition: ir_Midea.h:102
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
uint8_t SensorTemp
Degrees or OnTimer.
Definition: ir_Midea.h:68
void setSwingVToggle(const bool on)
Set the A/C to toggle the vertical swing toggle for the next send.
Definition: ir_Midea.cpp:326
bool isSwingVToggle(void) const
Is the current state a vertical swing toggle message?
Definition: ir_Midea.cpp:331
bool isLightToggle(void) const
Is the current state a Light (LED) toggle message?
Definition: ir_Midea.cpp:402
bool getEnableSensorTemp(void) const
Is the remote temperature sensor enabled?
Definition: ir_Midea.cpp:275
const uint8_t kMideaACMaxSensorTempC
Celsius.
Definition: ir_Midea.h:98
std::string String
Definition: IRremoteESP8266.h:1178
kSwingVToggleStr
Definition: ir_Midea.h:122
bool getSwingVToggle(void)
Definition: ir_Midea.cpp:338
uint8_t Fan
Definition: ir_Midea.h:80
uint8_t Mode
Definition: ir_Midea.h:79
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Midea.cpp:285
const uint64_t kMideaACToggleTurbo
Definition: ir_Midea.h:126
void off(void)
Set the requested power state of the A/C to off.
Definition: ir_Midea.cpp:156
bool getTurboToggle(void)
Definition: ir_Midea.cpp:391
void setOffTimer(const uint16_t mins)
Set the value of the Off Timer.
Definition: ir_Midea.cpp:505
const uint8_t kMideaACHeat
Definition: ir_Midea.h:106
uint8_t OffTimer
Nr of Half hours. Off is 0b111111.
Definition: ir_Midea.h:72
const uint64_t kMideaACSwingVStep
Definition: ir_Midea.h:115
bool isSwingVStep(void) const
Is the current state a step vertical swing message?
Definition: ir_Midea.cpp:350
void setLightToggle(const bool on)
Set the A/C to toggle the Light (LED) mode for the next send.
Definition: ir_Midea.cpp:398
bool getUseCelsius(void) const
Is the device currently using Celsius or the Fahrenheit temp scale?
Definition: ir_Midea.cpp:172
uint16_t getOnTimer(void) const
Get the value of the OnTimer is currently set to.
Definition: ir_Midea.cpp:470
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Midea.cpp:543
const uint8_t kMideaACFanAuto
Definition: ir_Midea.h:108
const uint64_t kMideaACToggleSwingV
Definition: ir_Midea.h:114
IRsend _irsend
Instance of the IR send class.
Definition: ir_Midea.h:219
uint64_t remote_state
The state in native IR code form.
Definition: ir_Midea.h:55
Class for handling detailed Midea A/C messages.
Definition: ir_Midea.h:151
const uint8_t kMideaACMinSensorTempC
Celsius.
Definition: ir_Midea.h:97
void setRaw(const uint64_t newState)
Set the internal state from a valid code for this protocol.
Definition: ir_Midea.cpp:150
uint8_t getSensorTemp(const bool useCelsius=false) const
Get the current Sensor temperature setting.
Definition: ir_Midea.cpp:248
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Midea.cpp:297
static uint8_t calcChecksum(const uint64_t state)
Calculate the checksum for a given state.
Definition: ir_Midea.cpp:416
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:319
const uint8_t kMideaACSensorTempOnTimerOff
Definition: ir_Midea.h:101
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Midea.cpp:291
const uint64_t kMideaACToggleEcono
Definition: ir_Midea.h:124
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Midea.cpp:529
uint8_t Sleep
Definition: ir_Midea.h:84
const uint8_t kMideaACFanMed
Definition: ir_Midea.h:110
uint8_t disableSensor
Definition: ir_Midea.h:69
uint64_t getRaw(void)
Get a copy of the internal state/code for this protocol.
Definition: ir_Midea.cpp:143
const uint8_t kMideaACMinTempC
Celsius.
Definition: ir_Midea.h:95
void setSwingVStep(const bool on)
Set the A/C to step the vertical swing for the next send.
Definition: ir_Midea.cpp:346
bool getSwingVStep(void)
Definition: ir_Midea.cpp:356
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Midea.cpp:516
const uint64_t kMideaACToggleLight
Definition: ir_Midea.h:125
const uint8_t kMideaACFanHigh
Definition: ir_Midea.h:111
bool getEconoToggle(void)
Definition: ir_Midea.cpp:374
const uint8_t kMideaACMaxTempC
Celsius.
Definition: ir_Midea.h:96
void setEnableSensorTemp(const bool on)
Enable the remote's Sensor temperature.
Definition: ir_Midea.cpp:262
stdAc::state_t toCommon(const stdAc::state_t *prev=NULL)
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Midea.cpp:568
void setSensorTemp(const uint8_t temp, const bool useCelsius=false)
Set the Sensor temperature.
Definition: ir_Midea.cpp:225
const uint8_t kMideaACDry
Definition: ir_Midea.h:104
bool isTurboToggle(void) const
Is the current state a Turbo toggle message?
Definition: ir_Midea.cpp:385
String toString(void)
Convert the current internal state into a human readable string.
Definition: ir_Midea.cpp:605
static bool validChecksum(const uint64_t state)
Verify the checksum is valid for a given state.
Definition: ir_Midea.cpp:431
const uint8_t kMideaACMinSensorTempF
Fahrenheit.
Definition: ir_Midea.h:99
bool _LightToggle
Definition: ir_Midea.h:232
const uint8_t kMideaACCool
Definition: ir_Midea.h:103
Native representation of a Midea A/C message.
Definition: ir_Midea.h:54
void setPower(const bool on)
Change the power setting.
Definition: ir_Midea.cpp:160
uint8_t BeepDisable
0 = no beep in follow me messages, 1 = beep.
Definition: ir_Midea.h:73
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:109
bool _SwingVStep
Definition: ir_Midea.h:228
uint8_t getTemp(const bool useCelsius=false) const
Get the current temperature setting.
Definition: ir_Midea.cpp:210
uint8_t Temp
Definition: ir_Midea.h:75
void setFan(const uint8_t fan)
Set the speed of the fan.
Definition: ir_Midea.cpp:279
const uint8_t kMideaACTypeCommand
Message type.
Definition: ir_Midea.h:127
bool isEconoToggle(void) const
Is the current state an Econo (energy saver) toggle message?
Definition: ir_Midea.cpp:368
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46