Go to the documentation of this file.
20 #define __STDC_LIMIT_MACROS
28 #include "IRsend_test.h"
96 #define GREE_AUTO kGreeAuto
97 #define GREE_COOL kGreeCool
98 #define GREE_DRY kGreeDry
99 #define GREE_FAN kGreeFan
100 #define GREE_HEAT kGreeHeat
101 #define GREE_MIN_TEMP kGreeMinTempC
102 #define GREE_MAX_TEMP kGreeMaxTempC
103 #define GREE_FAN_MAX kGreeFanMax
104 #define GREE_SWING_LAST_POS kGreeSwingLastPos
105 #define GREE_SWING_AUTO kGreeSwingAuto
106 #define GREE_SWING_UP kGreeSwingUp
107 #define GREE_SWING_MIDDLE_UP kGreeSwingMiddleUp
108 #define GREE_SWING_MIDDLE kGreeSwingMiddle
109 #define GREE_SWING_MIDDLE_DOWN kGreeSwingMiddleDown
110 #define GREE_SWING_DOWN kGreeSwingDown
111 #define GREE_SWING_DOWN_AUTO kGreeSwingDownAuto
112 #define GREE_SWING_MIDDLE_AUTO kGreeSwingMiddleAuto
113 #define GREE_SWING_UP_AUTO kGreeSwingUpAuto
122 const bool inverted =
false,
const bool use_modulation =
true);
139 void setTemp(
const uint8_t temp,
const bool fahrenheit =
false);
143 void setFan(
const uint8_t speed);
145 void setMode(
const uint8_t new_mode);
163 void setTimer(
const uint16_t minutes);
174 void setRaw(
const uint8_t new_code[]);
void setSwingVertical(const bool automatic, const uint8_t position)
Set the Vertical Swing mode of the A/C.
Definition: ir_Gree.cpp:395
const uint8_t kGreeTimerTensHrSize
Definition: ir_Gree.h:58
const uint16_t kGreeStateLength
Definition: IRremoteESP8266.h:883
uint8_t getTemp(void)
Get the set temperature.
Definition: ir_Gree.cpp:269
const uint8_t kGreeIFeelOffset
Definition: ir_Gree.h:86
const uint8_t kGreeXfanOffset
Definition: ir_Gree.h:68
bool getPower(void)
Get the value of the current power setting.
Definition: ir_Gree.cpp:220
const uint8_t kGreeSwingUp
Definition: ir_Gree.h:76
swingv_t
Common A/C settings for Vertical Swing.
Definition: IRsend.h:70
static bool validChecksum(const uint8_t state[], const uint16_t length=kGreeStateLength)
Verify the checksum is valid for a given state.
Definition: ir_Gree.cpp:181
String toString(void)
Convert the current internal state into a human readable string.
Definition: ir_Gree.cpp:609
const uint8_t kGreeFanSize
Definition: ir_Gree.h:42
void off(void)
Change the power setting to Off.
Definition: ir_Gree.cpp:205
uint16_t getTimer(void)
Get the timer time value from the A/C.
Definition: ir_Gree.cpp:449
const uint8_t kGreeFan
Definition: ir_Gree.h:36
void setXFan(const bool on)
Set the XFan (Mould) setting of the A/C.
Definition: ir_Gree.cpp:358
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivilant.
Definition: ir_Gree.cpp:542
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Gree.cpp:501
const uint8_t kGreeDry
Definition: ir_Gree.h:35
const uint8_t kGreeFanMax
Definition: ir_Gree.h:46
const uint8_t kGreeSleepOffset
Definition: ir_Gree.h:48
const uint8_t kGreeMaxTempF
Definition: ir_Gree.h:55
void setMode(const uint8_t new_mode)
Set the operating mode of the A/C.
Definition: ir_Gree.cpp:298
gree_ac_remote_model_t getModel(void)
Get/Detect the model of the A/C.
Definition: ir_Gree.cpp:199
stdAc::state_t toCommon(void)
Convert the current internal state into its stdAc::state_t equivilant.
Definition: ir_Gree.cpp:580
gree_ac_remote_model_t
Gree A/C model numbers.
Definition: IRsend.h:129
void send(const uint16_t repeat=kGreeDefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Gree.cpp:143
const uint8_t kGreeSwingUpAuto
Definition: ir_Gree.h:83
const uint8_t kGreeDisplayTempOutside
Definition: ir_Gree.h:92
void fixup(void)
Fix up the internal state so it is correct.
Definition: ir_Gree.cpp:132
const uint8_t kGreeSwingDownAuto
Definition: ir_Gree.h:81
const uint8_t kGreeSwingSize
Definition: ir_Gree.h:73
void setPower(const bool on)
Change the power setting.
Definition: ir_Gree.cpp:210
bool getUseFahrenheit(void)
Get the default temperature units in use.
Definition: ir_Gree.cpp:234
const uint8_t kGreeTimerTensHrOffset
Definition: ir_Gree.h:57
void setTimerEnabled(const bool on)
Set the timer enable setting of the A/C.
Definition: ir_Gree.cpp:437
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Gree.cpp:151
bool getSwingVerticalAuto(void)
Get the Vertical Swing Automatic mode setting of the A/C.
Definition: ir_Gree.cpp:425
bool getLight(void)
Get the Light (LED) setting of the A/C.
Definition: ir_Gree.cpp:328
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
const uint8_t kGreeSwingAutoOffset
Definition: ir_Gree.h:47
std::string String
Definition: IRremoteESP8266.h:1093
const uint8_t kGreeDisplayTempSet
Definition: ir_Gree.h:90
const uint8_t kGreeTempOffset
Definition: ir_Gree.h:50
const uint8_t kGreeSwingMiddleDown
Definition: ir_Gree.h:79
IRGreeAC(const uint16_t pin, const gree_ac_remote_model_t model=gree_ac_remote_model_t::YAW1F, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Gree.cpp:112
const uint8_t kGreeFanMed
Definition: ir_Gree.h:45
bool getSleep(void)
Get the Sleep setting of the A/C.
Definition: ir_Gree.cpp:376
const uint8_t kGreeSwingMiddleAuto
Definition: ir_Gree.h:82
uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Gree.cpp:514
const uint8_t kGreeHeat
Definition: ir_Gree.h:37
void setSleep(const bool on)
Set the Sleep setting of the A/C.
Definition: ir_Gree.cpp:370
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Gree.cpp:138
const uint16_t kGreeTimerMax
Definition: ir_Gree.h:59
@ YAW1F
Definition: IRsend.h:130
const uint8_t kGreeMaxTempC
Definition: ir_Gree.h:53
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Gree.h:130
uint8_t getSwingVerticalPosition(void)
Get the Vertical Swing position setting of the A/C.
Definition: ir_Gree.cpp:431
uint8_t getFan(void)
Get the current fan speed setting.
Definition: ir_Gree.cpp:292
const uint8_t kGreeMinTempF
Definition: ir_Gree.h:54
const uint8_t kGreeTurboOffset
Definition: ir_Gree.h:64
const uint8_t kGreeDisplayTempOff
Definition: ir_Gree.h:89
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Gree.cpp:283
void setUseFahrenheit(const bool on)
Set the default temperature units to use.
Definition: ir_Gree.cpp:228
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivilant.
Definition: ir_Gree.cpp:555
const uint8_t kGreeTimerHoursOffset
Definition: ir_Gree.h:62
const uint8_t kGreePower1Offset
Definition: ir_Gree.h:40
const uint8_t kGreeTimerHalfHrOffset
Definition: ir_Gree.h:56
bool getIFeel(void)
Get the IFeel setting of the A/C.
Definition: ir_Gree.cpp:340
const uint8_t kGreeTimerHoursSize
Definition: ir_Gree.h:63
void checksum(const uint16_t length=kGreeStateLength)
Calculate and set the checksum values for the internal state.
Definition: ir_Gree.cpp:171
bool getTimerEnabled(void)
Get the timer enabled setting of the A/C.
Definition: ir_Gree.cpp:443
const uint8_t kGreeDisplayTempSize
Definition: ir_Gree.h:88
void setTimer(const uint16_t minutes)
Set the A/C's timer to turn off in X many minutes.
Definition: ir_Gree.cpp:461
void setModel(const gree_ac_remote_model_t model)
Set the model of the A/C to emulate.
Definition: ir_Gree.cpp:189
bool getTurbo(void)
Get the Turbo setting of the A/C.
Definition: ir_Gree.cpp:388
const uint8_t kGreeFanOffset
Definition: ir_Gree.h:41
const uint8_t kGreeAuto
Definition: ir_Gree.h:33
void setWiFi(const bool on)
Set the Wifi (enabled) setting of the A/C.
Definition: ir_Gree.cpp:346
uint8_t convertSwingV(const stdAc::swingv_t swingv)
Convert a stdAc::swingv_t enum into it's native setting.
Definition: ir_Gree.cpp:528
void setIFeel(const bool on)
Set the IFeel setting of the A/C.
Definition: ir_Gree.cpp:334
const uint8_t kGreeSwingMiddleUp
Definition: ir_Gree.h:77
uint8_t remote_state[kGreeStateLength]
The state in native IR code form.
Definition: ir_Gree.h:187
uint8_t getDisplayTempSource(void)
Get the temperature display mode. i.e. Internal, External temperature sensing.
Definition: ir_Gree.cpp:493
const uint8_t kGreeFanMin
Definition: ir_Gree.h:44
const uint8_t kGreeCool
Definition: ir_Gree.h:34
const uint8_t kGreeSwingMiddle
Definition: ir_Gree.h:78
bool getXFan(void)
Get the XFan (Mould) setting of the A/C.
Definition: ir_Gree.cpp:364
const uint8_t kGreeSwingLastPos
Definition: ir_Gree.h:74
void setTemp(const uint8_t temp, const bool fahrenheit=false)
Set the temp. in degrees.
Definition: ir_Gree.cpp:244
gree_ac_remote_model_t _model
Definition: ir_Gree.h:188
const uint8_t kGreeWiFiOffset
Definition: ir_Gree.h:85
const uint8_t kGreeTimerEnabledOffset
Definition: ir_Gree.h:60
void setTurbo(const bool on)
Set the Turbo setting of the A/C.
Definition: ir_Gree.cpp:382
const uint8_t kGreeSwingDown
Definition: ir_Gree.h:80
static stdAc::swingv_t toCommonSwingV(const uint8_t pos)
Convert a stdAc::swingv_t enum into it's native setting.
Definition: ir_Gree.cpp:567
const uint8_t kGreeFanAuto
Definition: ir_Gree.h:43
const uint8_t kGreeUseFahrenheitOffset
Definition: ir_Gree.h:71
const uint8_t kGreeMinTempC
Definition: ir_Gree.h:52
const uint8_t kGreeTempSize
Definition: ir_Gree.h:51
void setDisplayTempSource(const uint8_t mode)
Set temperature display mode. i.e. Internal, External temperature sensing.
Definition: ir_Gree.cpp:486
const uint8_t kGreeSwingAuto
Definition: ir_Gree.h:75
Class for handling detailed Gree A/C messages.
Definition: ir_Gree.h:117
uint8_t getMode(void)
Get the operating mode setting of the A/C.
Definition: ir_Gree.cpp:316
const uint8_t kGreeTempExtraDegreeFOffset
Definition: ir_Gree.h:70
const uint8_t kGreeDisplayTempInside
Definition: ir_Gree.h:91
void stateReset(void)
Reset the internal state to a fixed known good state.
Definition: ir_Gree.cpp:120
const uint8_t kGreePower2Offset
Definition: ir_Gree.h:67
const uint8_t kGreeLightOffset
Definition: ir_Gree.h:65
bool getWiFi(void)
Get the Wifi (enabled) setting of the A/C.
Definition: ir_Gree.cpp:352
Structure to hold a common A/C state.
Definition: IRsend.h:97
void setRaw(const uint8_t new_code[])
Set the internal state from a valid code for this protocol.
Definition: ir_Gree.cpp:158
IRsend _irsend
Instance of the IR send class.
Definition: ir_Gree.h:181
const uint8_t kGreeDisplayTempOffset
Definition: ir_Gree.h:87
void on(void)
Change the power setting to On.
Definition: ir_Gree.cpp:202
void setLight(const bool on)
Set the Light (LED) setting of the A/C.
Definition: ir_Gree.cpp:322
const uint16_t kGreeDefaultRepeat
Definition: IRremoteESP8266.h:885
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46