Go to the documentation of this file.
25 #define __STDC_LIMIT_MACROS
33 #include "IRsend_test.h"
115 #define GREE_AUTO kGreeAuto
116 #define GREE_COOL kGreeCool
117 #define GREE_DRY kGreeDry
118 #define GREE_FAN kGreeFan
119 #define GREE_HEAT kGreeHeat
120 #define GREE_MIN_TEMP kGreeMinTempC
121 #define GREE_MAX_TEMP kGreeMaxTempC
122 #define GREE_FAN_MAX kGreeFanMax
123 #define GREE_SWING_LAST_POS kGreeSwingLastPos
124 #define GREE_SWING_AUTO kGreeSwingAuto
125 #define GREE_SWING_UP kGreeSwingUp
126 #define GREE_SWING_MIDDLE_UP kGreeSwingMiddleUp
127 #define GREE_SWING_MIDDLE kGreeSwingMiddle
128 #define GREE_SWING_MIDDLE_DOWN kGreeSwingMiddleDown
129 #define GREE_SWING_DOWN kGreeSwingDown
130 #define GREE_SWING_DOWN_AUTO kGreeSwingDownAuto
131 #define GREE_SWING_MIDDLE_AUTO kGreeSwingMiddleAuto
132 #define GREE_SWING_UP_AUTO kGreeSwingUpAuto
141 const bool inverted =
false,
const bool use_modulation =
true);
158 void setTemp(
const uint8_t temp,
const bool fahrenheit =
false);
162 void setFan(
const uint8_t speed);
163 uint8_t
getFan(
void)
const;
164 void setMode(
const uint8_t new_mode);
182 void setTimer(
const uint16_t minutes);
193 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:387
uint8_t ModelA
Definition: ir_Gree.h:55
uint8_t Temp
Definition: ir_Gree.h:47
uint8_t Mode
Definition: ir_Gree.h:41
GreeProtocol _
Definition: ir_Gree.h:206
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Gree.cpp:308
bool getWiFi(void) const
Get the Wifi (enabled) setting of the A/C.
Definition: ir_Gree.cpp:344
const uint16_t kGreeStateLength
Definition: IRremoteESP8266.h:1038
const uint8_t kGreeSwingUp
Definition: ir_Gree.h:100
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:177
String toString(void)
Convert the current internal state into a human readable string.
Definition: ir_Gree.cpp:596
void off(void)
Change the power setting to Off.
Definition: ir_Gree.cpp:201
const uint8_t kGreeFan
Definition: ir_Gree.h:84
void setXFan(const bool on)
Set the XFan (Mould) setting of the A/C.
Definition: ir_Gree.cpp:350
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Gree.cpp:529
bool getIFeel(void) const
Get the IFeel setting of the A/C.
Definition: ir_Gree.cpp:332
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
bool getLight(void) const
Get the Light (LED) setting of the A/C.
Definition: ir_Gree.cpp:320
uint8_t SwingAuto
Definition: ir_Gree.h:44
uint8_t TempExtraDegreeF
Definition: ir_Gree.h:59
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Gree.cpp:488
const uint8_t kGreeDry
Definition: ir_Gree.h:83
uint8_t unknown1
Definition: ir_Gree.h:61
const uint8_t kGreeFanMax
Definition: ir_Gree.h:90
const uint8_t kGreeMaxTempF
Definition: ir_Gree.h:95
uint16_t getTimer(void) const
Get the timer time value from the A/C.
Definition: ir_Gree.cpp:441
void setMode(const uint8_t new_mode)
Set the operating mode of the A/C.
Definition: ir_Gree.cpp:290
uint8_t Fan
Definition: ir_Gree.h:43
stdAc::state_t toCommon(void)
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Gree.cpp:567
uint8_t WiFi
Definition: ir_Gree.h:69
gree_ac_remote_model_t
Gree A/C model numbers.
Definition: IRsend.h:134
void send(const uint16_t repeat=kGreeDefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Gree.cpp:141
const uint8_t kGreeSwingUpAuto
Definition: ir_Gree.h:107
const uint8_t kGreeDisplayTempOutside
Definition: ir_Gree.h:112
void fixup(void)
Fix up the internal state so it is correct.
Definition: ir_Gree.cpp:130
uint8_t remote_state[kGreeStateLength]
The state in native IR code form.
Definition: ir_Gree.h:38
const uint8_t kGreeSwingDownAuto
Definition: ir_Gree.h:105
void setPower(const bool on)
Change the power setting.
Definition: ir_Gree.cpp:206
void setTimerEnabled(const bool on)
Set the timer enable setting of the A/C.
Definition: ir_Gree.cpp:429
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Gree.cpp:148
Class for sending all basic IR protocols.
Definition: IRsend.h:190
uint8_t Turbo
Definition: ir_Gree.h:53
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
uint8_t Swing
Definition: ir_Gree.h:63
std::string String
Definition: IRremoteESP8266.h:1279
const uint8_t kGreeDisplayTempSet
Definition: ir_Gree.h:110
uint8_t TimerHours
Definition: ir_Gree.h:52
uint8_t TimerHalfHr
Definition: ir_Gree.h:48
const uint8_t kGreeSwingMiddleDown
Definition: ir_Gree.h:103
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:111
uint8_t Sum
Definition: ir_Gree.h:75
const uint8_t kGreeFanMed
Definition: ir_Gree.h:89
const uint8_t kGreeSwingMiddleAuto
Definition: ir_Gree.h:106
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Gree.cpp:501
const uint8_t kGreeHeat
Definition: ir_Gree.h:85
void setSleep(const bool on)
Set the Sleep setting of the A/C.
Definition: ir_Gree.cpp:362
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Gree.cpp:136
const uint16_t kGreeTimerMax
Definition: ir_Gree.h:96
@ YAW1F
Definition: IRsend.h:135
const uint8_t kGreeMaxTempC
Definition: ir_Gree.h:93
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Gree.h:149
uint8_t Sleep
Definition: ir_Gree.h:45
const uint8_t kGreeMinTempF
Definition: ir_Gree.h:94
const uint8_t kGreeDisplayTempOff
Definition: ir_Gree.h:109
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Gree.cpp:275
void setUseFahrenheit(const bool on)
Set the default temperature units to use.
Definition: ir_Gree.cpp:223
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Gree.cpp:542
uint8_t unknown2
Definition: ir_Gree.h:68
bool getTurbo(void) const
Get the Turbo setting of the A/C.
Definition: ir_Gree.cpp:380
uint8_t TimerTensHr
Definition: ir_Gree.h:49
bool getPower(void) const
Get the value of the current power setting.
Definition: ir_Gree.cpp:215
bool getXFan(void) const
Get the XFan (Mould) setting of the A/C.
Definition: ir_Gree.cpp:356
void checksum(const uint16_t length=kGreeStateLength)
Calculate and set the checksum values for the internal state.
Definition: ir_Gree.cpp:168
uint8_t Xfan
Definition: ir_Gree.h:56
uint8_t Light
Definition: ir_Gree.h:54
void setTimer(const uint16_t minutes)
Set the A/C's timer to turn off in X many minutes.
Definition: ir_Gree.cpp:451
void setModel(const gree_ac_remote_model_t model)
Set the model of the A/C to emulate.
Definition: ir_Gree.cpp:185
gree_ac_remote_model_t getModel(void) const
Get/Detect the model of the A/C.
Definition: ir_Gree.cpp:195
const uint8_t kGreeAuto
Definition: ir_Gree.h:81
void setWiFi(const bool on)
Set the Wifi (enabled) setting of the A/C.
Definition: ir_Gree.cpp:338
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Gree.cpp:284
static uint8_t convertSwingV(const stdAc::swingv_t swingv)
Convert a stdAc::swingv_t enum into it's native setting.
Definition: ir_Gree.cpp:515
bool getUseFahrenheit(void) const
Get the default temperature units in use.
Definition: ir_Gree.cpp:229
void setIFeel(const bool on)
Set the IFeel setting of the A/C.
Definition: ir_Gree.cpp:326
const uint8_t kGreeSwingMiddleUp
Definition: ir_Gree.h:101
uint8_t getTemp(void) const
Get the set temperature.
Definition: ir_Gree.cpp:262
uint8_t IFeel
Definition: ir_Gree.h:67
const uint8_t kGreeFanMin
Definition: ir_Gree.h:88
const uint8_t kGreeCool
Definition: ir_Gree.h:82
uint8_t getSwingVerticalPosition(void) const
Get the Vertical Swing position setting of the A/C.
Definition: ir_Gree.cpp:423
const uint8_t kGreeSwingMiddle
Definition: ir_Gree.h:102
Native representation of a Gree A/C message.
Definition: ir_Gree.h:37
const uint8_t kGreeSwingLastPos
Definition: ir_Gree.h:98
void setTemp(const uint8_t temp, const bool fahrenheit=false)
Set the temp. in degrees.
Definition: ir_Gree.cpp:239
bool getTimerEnabled(void) const
Get the timer enabled setting of the A/C.
Definition: ir_Gree.cpp:435
gree_ac_remote_model_t _model
Definition: ir_Gree.h:207
bool getSwingVerticalAuto(void) const
Get the Vertical Swing Automatic mode setting of the A/C.
Definition: ir_Gree.cpp:417
void setTurbo(const bool on)
Set the Turbo setting of the A/C.
Definition: ir_Gree.cpp:374
const uint8_t kGreeSwingDown
Definition: ir_Gree.h:104
static stdAc::swingv_t toCommonSwingV(const uint8_t pos)
Convert a native Vertical Swing into its stdAc equivalent.
Definition: ir_Gree.cpp:554
const uint8_t kGreeFanAuto
Definition: ir_Gree.h:87
uint8_t Power
Definition: ir_Gree.h:42
bool getSleep(void) const
Get the Sleep setting of the A/C.
Definition: ir_Gree.cpp:368
uint8_t TimerEnabled
Definition: ir_Gree.h:50
const uint8_t kGreeMinTempC
Definition: ir_Gree.h:92
uint8_t getDisplayTempSource(void) const
Get the temperature display mode. i.e. Internal, External temperature sensing.
Definition: ir_Gree.cpp:481
void setDisplayTempSource(const uint8_t mode)
Set temperature display mode. i.e. Internal, External temperature sensing.
Definition: ir_Gree.cpp:474
uint8_t UseFahrenheit
Definition: ir_Gree.h:60
const uint8_t kGreeSwingAuto
Definition: ir_Gree.h:99
Class for handling detailed Gree A/C messages.
Definition: ir_Gree.h:136
uint8_t DisplayTemp
Definition: ir_Gree.h:66
const uint8_t kGreeDisplayTempInside
Definition: ir_Gree.h:111
void stateReset(void)
Reset the internal state to a fixed known good state.
Definition: ir_Gree.cpp:119
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:155
IRsend _irsend
Instance of the IR send class.
Definition: ir_Gree.h:200
void on(void)
Change the power setting to On.
Definition: ir_Gree.cpp:198
void setLight(const bool on)
Set the Light (LED) setting of the A/C.
Definition: ir_Gree.cpp:314
const uint16_t kGreeDefaultRepeat
Definition: IRremoteESP8266.h:1040
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46