Go to the documentation of this file.
32 #define __STDC_LIMIT_MACROS
40 #include "IRsend_test.h"
122 explicit IRCoolixAC(
const uint16_t pin,
const bool inverted =
false,
123 const bool use_modulation =
true);
132 #endif // SEND_COOLIX
138 void setTemp(
const uint8_t temp);
143 void setFan(
const uint8_t speed,
const bool modecheck =
true);
144 uint8_t
getFan(
void)
const;
145 void setMode(
const uint8_t mode);
160 uint32_t
getRaw(
void)
const;
161 void setRaw(
const uint32_t new_code);
200 #endif // IR_COOLIX_H_
bool getSwing(void) const
Get the Swing setting of the A/C.
Definition: ir_Coolix.cpp:281
const uint8_t kCoolixFanZoneFollow
Definition: ir_Coolix.h:58
bool getClean(void) const
Get the Clean setting of the A/C.
Definition: ir_Coolix.cpp:333
uint32_t getNormalState(void)
uint8_t savedFan
Definition: ir_Coolix.h:188
void setTempRaw(const uint8_t code)
Set the raw (native) temperature value.
Definition: ir_Coolix.cpp:214
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Coolix.cpp:401
void setSensorTempRaw(const uint8_t code)
Set the raw (native) sensor temperature value.
Definition: ir_Coolix.cpp:241
const uint8_t kCoolixFanMin
Definition: ir_Coolix.h:53
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Coolix.h:131
void setZoneFollow(const bool on)
Change the Zone Follow setting.
Definition: ir_Coolix.cpp:350
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Coolix.cpp:364
const uint32_t kCoolixSwingH
Definition: ir_Coolix.h:87
uint32_t getRaw(void) const
Get a copy of the internal state as a valid code for this protocol.
Definition: ir_Coolix.cpp:125
void send(const uint16_t repeat=kCoolixDefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Coolix.cpp:110
void clearSensorTemp(void)
Clear the Sensor Temperature setting..
Definition: ir_Coolix.cpp:357
void on(void)
Change the power setting to On.
Definition: ir_Coolix.cpp:274
const uint8_t kCoolixFanAuto0
Definition: ir_Coolix.h:57
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:61
const uint8_t kCoolixDry
Definition: ir_Coolix.h:46
bool getLed(void) const
Get the Led (light) setting of the A/C.
Definition: ir_Coolix.cpp:322
bool getTurbo(void) const
Get the Turbo setting of the A/C.
Definition: ir_Coolix.cpp:311
const uint8_t kCoolixFanMed
Definition: ir_Coolix.h:54
IRsend _irsend
Instance of the IR send class.
Definition: ir_Coolix.h:172
bool turboFlag
Definition: ir_Coolix.h:183
bool ledFlag
Definition: ir_Coolix.h:184
const uint32_t kCoolixSwing
Definition: ir_Coolix.h:86
void setLed(void)
Toggle the Led (light) mode of the A/C.
Definition: ir_Coolix.cpp:325
const uint8_t kCoolixCool
Definition: ir_Coolix.h:45
const uint8_t kCoolixAuto
Definition: ir_Coolix.h:47
Class for sending all basic IR protocols.
Definition: IRsend.h:237
bool cleanFlag
Definition: ir_Coolix.h:185
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Coolix.cpp:486
Native representation of a Coolix A/C message.
Definition: ir_Coolix.h:98
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 kCoolixHeat
Definition: ir_Coolix.h:48
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a standard A/C mode into its native mode.
Definition: ir_Coolix.cpp:446
const uint32_t kCoolixOff
Definition: ir_Coolix.h:85
std::string String
Definition: IRremoteESP8266.h:1521
void recoverSavedState(void)
Restore the current internal state from backup as long as it isn't a special state.
Definition: ir_Coolix.cpp:203
const uint8_t kCoolixFanTempCode
Definition: ir_Coolix.h:64
void setSensorTemp(const uint8_t temp)
Set the sensor temperature.
Definition: ir_Coolix.cpp:247
void setTurbo(void)
Toggle the Turbo mode of the A/C.
Definition: ir_Coolix.cpp:314
uint8_t getTemp(void) const
Get the current temperature setting.
Definition: ir_Coolix.cpp:231
void off(void)
Change the power setting to Off.
Definition: ir_Coolix.cpp:277
uint32_t Fan
Fan speed.
Definition: ir_Coolix.h:108
const uint8_t kCoolixTempMap[kCoolixTempRange]
Definition: ir_Coolix.h:65
const uint32_t kCoolixClean
Definition: ir_Coolix.h:92
CoolixProtocol _
The state of the IR remote in IR code form.
Definition: ir_Coolix.h:178
const uint8_t kCoolixFanFixed
Definition: ir_Coolix.h:59
void stateReset(void)
Reset the internal state to a fixed known good state.
Definition: ir_Coolix.cpp:92
bool getSleep(void) const
Get the Sleep setting of the A/C.
Definition: ir_Coolix.cpp:301
const uint32_t kCoolixDefaultState
Definition: ir_Coolix.h:95
uint32_t SensorTemp
The temperature sensor in the IR remote.
Definition: ir_Coolix.h:107
const uint16_t kCoolixDefaultRepeat
Definition: IRremoteESP8266.h:1172
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Coolix.cpp:459
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode to it's common stdAc::opmode_t equivalent.
Definition: ir_Coolix.cpp:473
void setTemp(const uint8_t temp)
Set the temperature.
Definition: ir_Coolix.cpp:222
void setSwingVStep(void)
Set the Vertical Swing Step setting of the A/C.
Definition: ir_Coolix.cpp:295
uint8_t getSensorTemp(void) const
Get the sensor temperature setting.
Definition: ir_Coolix.cpp:254
Class for handling detailed Coolix A/C messages.
Definition: ir_Coolix.h:120
uint8_t getTempRaw(void) const
Get the raw (native) temperature value.
Definition: ir_Coolix.cpp:218
bool getZoneFollow(void) const
Get the Zone Follow setting of the A/C.
Definition: ir_Coolix.cpp:343
CoolixProtocol _saved
Copy of the state if we required a special mode.
Definition: ir_Coolix.h:179
void setClean(void)
Toggle the Clean mode of the A/C.
Definition: ir_Coolix.cpp:336
const uint32_t kCoolixLed
Definition: ir_Coolix.h:91
void setSwing(void)
Toggle the Swing mode of the A/C.
Definition: ir_Coolix.cpp:284
void setRaw(const uint32_t new_code)
Set the internal state from a valid code for this protocol.
Definition: ir_Coolix.cpp:129
uint32_t Mode
Operation mode.
Definition: ir_Coolix.h:104
const uint32_t kCoolixCmdFan
Definition: ir_Coolix.h:93
uint32_t raw
The state in IR code form.
Definition: ir_Coolix.h:99
const uint8_t kCoolixTempMax
Definition: ir_Coolix.h:62
bool swingFlag
Definition: ir_Coolix.h:187
const uint8_t kCoolixFan
Definition: ir_Coolix.h:49
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Coolix.cpp:105
const uint32_t kCoolixSwingV
Definition: ir_Coolix.h:88
void updateAndSaveState(const uint32_t raw_state)
Backup the current internal state as long as it isn't a special state and set the new state.
Definition: ir_Coolix.cpp:196
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Coolix.cpp:392
bool sleepFlag
Definition: ir_Coolix.h:186
const uint32_t kCoolixSleep
Definition: ir_Coolix.h:89
uint32_t ZoneFollow2
Additional control bit for Zone Follow mode.
Definition: ir_Coolix.h:111
IRCoolixAC(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Coolix.cpp:87
bool isSpecialState(void) const
Is the current state is a special state?
Definition: ir_Coolix.cpp:145
const uint8_t kCoolixTempRange
Definition: ir_Coolix.h:63
const uint8_t kCoolixTempMin
Definition: ir_Coolix.h:61
void setSleep(void)
Toggle the Sleep mode of the A/C.
Definition: ir_Coolix.cpp:304
const uint8_t kCoolixSensorTempMax
Definition: ir_Coolix.h:81
stdAc::state_t toCommon(const stdAc::state_t *prev=NULL) const
Convert the A/C state to it's common stdAc::state_t equivalent.
Definition: ir_Coolix.cpp:498
const uint8_t kCoolixFanMax
Definition: ir_Coolix.h:55
bool getPower(void) const
Get the value of the current power setting.
Definition: ir_Coolix.cpp:259
const uint8_t kCoolixFanAuto
Definition: ir_Coolix.h:56
bool powerFlag
Definition: ir_Coolix.h:182
uint32_t Temp
Desired temperature (Celsius)
Definition: ir_Coolix.h:105
String toString(void) const
Convert the internal state into a human readable string.
Definition: ir_Coolix.cpp:562
uint32_t ZoneFollow1
Control bit for Zone Follow mode.
Definition: ir_Coolix.h:103
bool getSwingVStep(void) const
Get the Vertical Swing Step setting of the A/C.
Definition: ir_Coolix.cpp:292
void setFan(const uint8_t speed, const bool modecheck=true)
Set the speed of the fan.
Definition: ir_Coolix.cpp:406
bool handleSpecialState(const uint32_t data)
Adjust any internal settings based on the type of special state we are supplied. Does nothing if it i...
Definition: ir_Coolix.cpp:165
Structure to hold a common A/C state.
Definition: IRsend.h:114
const uint8_t kCoolixSensorTempIgnoreCode
Definition: ir_Coolix.h:82
void setPower(const bool on)
Change the power setting.
Definition: ir_Coolix.cpp:263
const uint32_t kCoolixTurbo
Definition: ir_Coolix.h:90
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:49