Go to the documentation of this file.
21 #ifndef IR_KELVINATOR_H_
22 #define IR_KELVINATOR_H_
24 #define __STDC_LIMIT_MACROS
32 #include "IRsend_test.h"
118 #define KELVINATOR_MIN_TEMP kKelvinatorMinTemp
119 #define KELVINATOR_MAX_TEMP kKelvinatorMaxTemp
120 #define KELVINATOR_HEAT kKelvinatorHeat
121 #define KELVINATOR_FAN_MAX kKelvinatorFanMax
122 #define KELVINATOR_FAN_AUTO kKelvinatorFanAuto
123 #define KELVINATOR_FAN kKelvinatorFan
124 #define KELVINATOR_DRY kKelvinatorDry
125 #define KELVINATOR_COOL kKelvinatorCool
126 #define KELVINATOR_BASIC_FAN_MAX kKelvinatorBasicFanMax
127 #define KELVINATOR_AUTO_TEMP kKelvinatorAutoTemp
128 #define KELVINATOR_AUTO kKelvinatorAuto
134 explicit IRKelvinatorAC(
const uint16_t pin,
const bool inverted =
false,
135 const bool use_modulation =
true);
144 #endif // SEND_KELVINATOR
150 void setTemp(
const uint8_t degrees);
152 void setFan(
const uint8_t speed);
153 uint8_t
getFan(
void)
const;
154 void setMode(
const uint8_t mode);
174 void setRaw(
const uint8_t new_code[]);
198 #endif // IR_KELVINATOR_H_
const uint8_t kKelvinatorSwingVAuto
Definition: ir_Kelvinator.h:107
const uint8_t kKelvinatorSwingVLowerMiddle
Definition: ir_Kelvinator.h:111
const uint8_t kKelvinatorSwingVUpperMiddle
Definition: ir_Kelvinator.h:109
const uint8_t kKelvinatorSwingVHighest
Definition: ir_Kelvinator.h:108
void setSwingHorizontal(const bool on)
Control the current horizontal swing setting.
Definition: ir_Kelvinator.cpp:324
void stateReset(void)
Reset the internals of the object to a known good state.
Definition: ir_Kelvinator.cpp:115
void setTurbo(const bool on)
Control the current Turbo setting.
Definition: ir_Kelvinator.cpp:390
const uint8_t kKelvinatorFanAuto
Definition: ir_Kelvinator.h:99
swingv_t
Common A/C settings for Vertical Swing.
Definition: IRsend.h:74
void on(void)
Set the internal state to have the power on.
Definition: ir_Kelvinator.cpp:197
const uint8_t kKelvinatorFanMax
Definition: ir_Kelvinator.h:101
const uint8_t kKelvinatorCool
Definition: ir_Kelvinator.h:94
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:61
const uint8_t kKelvinatorSwingVHighAuto
Definition: ir_Kelvinator.h:115
void setLight(const bool on)
Control the current Light setting. i.e. The LED display on the A/C unit that shows the basic settings...
Definition: ir_Kelvinator.cpp:362
uint8_t IonFilter
Definition: ir_Kelvinator.h:52
const uint8_t kKelvinatorSwingVLowAuto
Definition: ir_Kelvinator.h:113
const uint8_t kKelvinatorSwingVLowest
Definition: ir_Kelvinator.h:112
uint8_t SwingV
Definition: ir_Kelvinator.h:60
void setSwingVertical(const bool automatic, const uint8_t position)
Set the Vertical Swing mode of the A/C.
Definition: ir_Kelvinator.cpp:281
uint8_t pad0[2]
Definition: ir_Kelvinator.h:64
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed to it's stdAc::fanspeed_t equivalent.
Definition: ir_Kelvinator.cpp:443
const uint8_t kKelvinatorAutoTemp
Definition: ir_Kelvinator.h:104
uint8_t SwingAuto
Definition: ir_Kelvinator.h:43
static stdAc::swingv_t toCommonSwingV(const uint8_t pos)
uint8_t * getRaw(void)
Get the raw state of the object, suitable to be sent with the appropriate IRsend object method.
Definition: ir_Kelvinator.cpp:147
bool getLight(void) const
Is the Light (Display) setting on?
Definition: ir_Kelvinator.cpp:368
uint8_t XFan
Definition: ir_Kelvinator.h:53
void setIonFilter(const bool on)
Control the current Ion Filter setting.
Definition: ir_Kelvinator.cpp:349
uint8_t getTemp(void) const
Get the current temperature setting.
Definition: ir_Kelvinator.cpp:224
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Kelvinator.cpp:230
Class for sending all basic IR protocols.
Definition: IRsend.h:237
const uint8_t kKelvinatorMinTemp
Definition: ir_Kelvinator.h:102
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Kelvinator.h:143
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
std::string String
Definition: IRremoteESP8266.h:1521
bool getSwingHorizontal(void) const
Is the horizontal swing setting on?
Definition: ir_Kelvinator.cpp:331
void setPower(const bool on)
Set the internal state to have the desired power.
Definition: ir_Kelvinator.cpp:204
void setMode(const uint8_t mode)
Set the desired operation mode.
Definition: ir_Kelvinator.cpp:258
void send(const uint16_t repeat=kKelvinatorDefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Kelvinator.cpp:139
const uint8_t kKelvinatorSwingVMiddle
Definition: ir_Kelvinator.h:110
void setRaw(const uint8_t new_code[])
Set the raw state of the object.
Definition: ir_Kelvinator.cpp:154
const uint8_t kKelvinatorSwingVMiddleAuto
Definition: ir_Kelvinator.h:114
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Kelvinator.cpp:122
static uint8_t calcBlockChecksum(const uint8_t *block, const uint16_t length=kKelvinatorStateLength/2)
Calculate the checksum for a given block of state.
Definition: ir_Kelvinator.cpp:163
uint8_t Power
Definition: ir_Kelvinator.h:41
IRsend _irsend
Instance of the IR send class.
Definition: ir_Kelvinator.h:187
const uint8_t kKelvinatorSwingVOff
Definition: ir_Kelvinator.h:106
uint8_t Light
Definition: ir_Kelvinator.h:51
uint8_t raw[kKelvinatorStateLength]
The state in IR code form.
Definition: ir_Kelvinator.h:37
bool getPower(void) const
Get the power setting from the internal state.
Definition: ir_Kelvinator.cpp:210
static bool validChecksum(const uint8_t state[], const uint16_t length=kKelvinatorStateLength)
Verify the checksum is valid for a given state.
Definition: ir_Kelvinator.cpp:185
Class for handling detailed Kelvinator A/C messages.
Definition: ir_Kelvinator.h:132
const uint8_t kKelvinatorMaxTemp
Definition: ir_Kelvinator.h:103
uint8_t Mode
Definition: ir_Kelvinator.h:40
uint8_t Sum1
Definition: ir_Kelvinator.h:67
void checksum(void)
Calculate the checksum for the internal state.
Definition: ir_Kelvinator.cpp:176
void fixup(void)
Fix up any odd conditions for the current state.
Definition: ir_Kelvinator.cpp:125
uint8_t pad1[3]
Definition: ir_Kelvinator.h:71
const uint16_t kKelvinatorStateLength
Definition: IRremoteESP8266.h:1289
stdAc::state_t toCommon(void) const
Convert the internal A/C object state to it's stdAc::state_t equivalent.
Definition: ir_Kelvinator.cpp:449
void setQuiet(const bool on)
Control the current Quiet setting.
Definition: ir_Kelvinator.cpp:337
void setXFan(const bool on)
Control the current XFan setting. This setting will cause the unit blow air after power off to dry ou...
Definition: ir_Kelvinator.cpp:377
uint8_t SwingH
Definition: ir_Kelvinator.h:61
const uint8_t kKelvinatorFan
Definition: ir_Kelvinator.h:96
String toString(void) const
Convert the internal settings into a human readable string.
Definition: ir_Kelvinator.cpp:475
void setTemp(const uint8_t degrees)
Set the temperature setting.
Definition: ir_Kelvinator.cpp:216
uint8_t Sum2
Definition: ir_Kelvinator.h:88
const uint8_t kKelvinatorBasicFanMax
Definition: ir_Kelvinator.h:98
const uint8_t kKelvinatorFanMin
Definition: ir_Kelvinator.h:100
bool getTurbo(void) const
Is the Turbo setting on?
Definition: ir_Kelvinator.cpp:396
KelvinatorProtocol _
Definition: ir_Kelvinator.h:193
uint8_t getMode(void) const
Get the current operation mode setting.
Definition: ir_Kelvinator.cpp:252
bool getSwingVerticalAuto(void) const
Get the Vertical Swing Automatic mode setting of the A/C.
Definition: ir_Kelvinator.cpp:312
uint8_t BasicFan
Definition: ir_Kelvinator.h:42
const uint8_t kKelvinatorHeat
Definition: ir_Kelvinator.h:97
bool getQuiet(void) const
Is the Quiet setting on?
Definition: ir_Kelvinator.cpp:343
IRKelvinatorAC(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Kelvinator.cpp:110
void off(void)
Set the internal state to have the power off.
Definition: ir_Kelvinator.cpp:200
const uint16_t kKelvinatorDefaultRepeat
Definition: IRremoteESP8266.h:1291
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Kelvinator.cpp:246
const uint8_t kKelvinatorDry
Definition: ir_Kelvinator.h:95
static uint8_t convertSwingV(const stdAc::swingv_t swingv)
Convert a stdAc::swingv_t enum into it's native setting.
Definition: ir_Kelvinator.cpp:416
uint8_t Quiet
Definition: ir_Kelvinator.h:80
bool getXFan(void) const
Is the XFan setting on?
Definition: ir_Kelvinator.cpp:383
Native representation of a Kelvinator A/C message.
Definition: ir_Kelvinator.h:36
bool getIonFilter(void) const
Is the Ion Filter setting on?
Definition: ir_Kelvinator.cpp:355
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode to it's stdAc::opmode_t equivalent.
Definition: ir_Kelvinator.cpp:430
Structure to hold a common A/C state.
Definition: IRsend.h:114
uint8_t Turbo
Definition: ir_Kelvinator.h:50
uint8_t Temp
Definition: ir_Kelvinator.h:46
uint8_t Fan
Definition: ir_Kelvinator.h:85
const uint8_t kKelvinatorAuto
Definition: ir_Kelvinator.h:93
uint8_t getSwingVerticalPosition(void) const
Get the Vertical Swing position setting of the A/C.
Definition: ir_Kelvinator.cpp:318
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a standard A/C mode (stdAc::opmode_t) into it a native mode.
Definition: ir_Kelvinator.cpp:403
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:49