IRremoteESP8266
|
#include <ir_Kelon.h>
Public Member Functions | |
IRKelonAc (uint16_t pin, bool inverted=false, bool use_modulation=true) | |
Class constructor. More... | |
void | stateReset (void) |
Reset the internals of the object to a known good state. More... | |
void | send (const uint16_t repeat=kNoRepeat) |
Send the current internal state as an IR message. More... | |
int8_t | calibrate (void) |
Run the calibration to calculate uSec timing offsets for this platform. More... | |
void | ensurePower (const bool on) |
Since the AC does not support actually setting the power state to a known value, this utility allow ensuring the AC is on or off by exploiting the fact that the AC, according to the user manual, will always turn on when setting it to "smart" or "super" mode. More... | |
void | begin (void) |
Set up hardware to be able to send a message. More... | |
void | setTogglePower (const bool toggle) |
Request toggling power - will be reset to false after sending. More... | |
bool | getTogglePower (void) const |
Get whether toggling power will be requested. More... | |
void | setTemp (const uint8_t degrees) |
Set the temperature setting. More... | |
uint8_t | getTemp (void) const |
Get the current temperature setting. More... | |
void | setFan (const uint8_t speed) |
Set the speed of the fan. More... | |
uint8_t | getFan (void) const |
Get the current fan speed setting. More... | |
void | setDryGrade (const int8_t grade) |
Set the dehumidification intensity. More... | |
int8_t | getDryGrade (void) const |
Get the current dehumidification intensity setting. In smart mode, this controls the temperature adjustment. More... | |
void | setMode (const uint8_t mode) |
Set the desired operation mode. More... | |
uint8_t | getMode (void) const |
Get the current operation mode setting. More... | |
void | setToggleSwingVertical (const bool toggle) |
Request toggling the vertical swing - will be reset to false after sending. More... | |
bool | getToggleSwingVertical (void) const |
Get whether the swing mode is set to be toggled. More... | |
void | setSleep (const bool on) |
Control the current sleep (quiet) setting. More... | |
bool | getSleep (void) const |
Is the sleep setting on? More... | |
void | setSupercool (const bool on) |
Control the current super cool mode setting. More... | |
bool | getSupercool (void) const |
Is the super cool mode setting on? More... | |
void | setTimer (const uint16_t mins) |
Set the timer time and enable it. Timer is an off timer if the unit is on, it is an on timer if the unit is off. Only multiples of 30m are supported for < 10h, then only multiples of 60m. More... | |
uint16_t | getTimer (void) const |
Get the set timer. Timer set time is deleted once the command is sent, so calling this after send() will return 0. The AC unit will continue keeping track of the remaining time unless it is later disabled. More... | |
void | setTimerEnabled (const bool on) |
Enable or disable the timer. Note that in order to enable the timer the minutes must be set with setTimer(). More... | |
bool | getTimerEnabled (void) const |
Get the current timer status. More... | |
uint64_t | getRaw (void) const |
Get the raw state of the object, suitable to be sent with the appropriate IRsend object method. More... | |
void | setRaw (const uint64_t new_code) |
Set the raw state of the object. More... | |
stdAc::state_t | toCommon (const stdAc::state_t *prev=nullptr) const |
Convert the internal A/C object state to it's stdAc::state_t equivalent. More... | |
String | toString (void) const |
Convert the internal settings into a human readable string. More... | |
Static Public Member Functions | |
static uint8_t | convertMode (const stdAc::opmode_t mode) |
Convert a standard A/C mode (stdAc::opmode_t) into it a native mode. More... | |
static uint8_t | convertFan (const stdAc::fanspeed_t fan) |
Convert a standard A/C fan speed (stdAc::fanspeed_t) into it a native speed. More... | |
static stdAc::opmode_t | toCommonMode (const uint8_t mode) |
Convert a native mode to it's stdAc::opmode_t equivalent. More... | |
static stdAc::fanspeed_t | toCommonFanSpeed (const uint8_t speed) |
Convert a native fan speed to it's stdAc::fanspeed_t equivalent. More... | |
Private Attributes | |
IRsend | _irsend |
Instance of the IR send class. More... | |
KelonProtocol | _ |
uint8_t | _previousMode = 0 |
uint8_t | _previousTemp = kKelonMinTemp |
uint8_t | _previousFan = kKelonFanAuto |
|
explicit |
Class constructor.
[in] | pin | GPIO to be used when sending. |
[in] | inverted | Is the output signal to be inverted? |
[in] | use_modulation | Is frequency modulation to be used? |
void IRKelonAc::begin | ( | void | ) |
Set up hardware to be able to send a message.
|
inline |
Run the calibration to calculate uSec timing offsets for this platform.
|
static |
Convert a standard A/C fan speed (stdAc::fanspeed_t) into it a native speed.
[in] | fan | A stdAc::fanspeed_t fan speed |
|
static |
Convert a standard A/C mode (stdAc::opmode_t) into it a native mode.
[in] | mode | A stdAc::opmode_t operation mode. |
void IRKelonAc::ensurePower | ( | const bool | on | ) |
Since the AC does not support actually setting the power state to a known value, this utility allow ensuring the AC is on or off by exploiting the fact that the AC, according to the user manual, will always turn on when setting it to "smart" or "super" mode.
Ensures the AC is on or off by exploiting the fact that setting it to "smart" will always turn it on if it's off. This method will send 2 commands to the AC to do the trick.
[in] | on | Whether to ensure the AC is on or off |
int8_t IRKelonAc::getDryGrade | ( | void | ) | const |
Get the current dehumidification intensity setting. In smart mode, this controls the temperature adjustment.
uint8_t IRKelonAc::getFan | ( | void | ) | const |
Get the current fan speed setting.
uint8_t IRKelonAc::getMode | ( | void | ) | const |
Get the current operation mode setting.
uint64_t IRKelonAc::getRaw | ( | void | ) | const |
Get the raw state of the object, suitable to be sent with the appropriate IRsend object method.
bool IRKelonAc::getSleep | ( | void | ) | const |
Is the sleep setting on?
bool IRKelonAc::getSupercool | ( | void | ) | const |
Is the super cool mode setting on?
uint8_t IRKelonAc::getTemp | ( | void | ) | const |
Get the current temperature setting.
uint16_t IRKelonAc::getTimer | ( | void | ) | const |
Get the set timer. Timer set time is deleted once the command is sent, so calling this after send() will return 0. The AC unit will continue keeping track of the remaining time unless it is later disabled.
bool IRKelonAc::getTimerEnabled | ( | void | ) | const |
Get the current timer status.
bool IRKelonAc::getTogglePower | ( | void | ) | const |
Get whether toggling power will be requested.
bool IRKelonAc::getToggleSwingVertical | ( | void | ) | const |
Get whether the swing mode is set to be toggled.
void IRKelonAc::send | ( | const uint16_t | repeat = kNoRepeat | ) |
Send the current internal state as an IR message.
[in] | repeat | Nr. of times the message will be repeated. |
void IRKelonAc::setDryGrade | ( | const int8_t | grade | ) |
Set the dehumidification intensity.
[in] | grade | has to be in the range [-2 : +2] |
void IRKelonAc::setFan | ( | const uint8_t | speed | ) |
Set the speed of the fan.
[in] | speed | 0 is auto, 1-5 is the speed |
void IRKelonAc::setMode | ( | const uint8_t | mode | ) |
Set the desired operation mode.
[in] | mode | The desired operation mode. |
void IRKelonAc::setRaw | ( | const uint64_t | new_code | ) |
Set the raw state of the object.
[in] | new_code | The raw state from the native IR message. |
void IRKelonAc::setSleep | ( | const bool | on | ) |
Control the current sleep (quiet) setting.
[in] | on | The desired setting. |
void IRKelonAc::setSupercool | ( | const bool | on | ) |
Control the current super cool mode setting.
[in] | on | The desired setting. |
void IRKelonAc::setTemp | ( | const uint8_t | degrees | ) |
Set the temperature setting.
[in] | degrees | The temperature in degrees celsius. |
void IRKelonAc::setTimer | ( | const uint16_t | mins | ) |
Set the timer time and enable it. Timer is an off timer if the unit is on, it is an on timer if the unit is off. Only multiples of 30m are supported for < 10h, then only multiples of 60m.
[in] | mins | Nr. of minutes |
void IRKelonAc::setTimerEnabled | ( | const bool | on | ) |
Enable or disable the timer. Note that in order to enable the timer the minutes must be set with setTimer().
[in] | on | Whether to enable or disable the timer |
void IRKelonAc::setTogglePower | ( | const bool | toggle | ) |
Request toggling power - will be reset to false after sending.
[in] | toggle | Whether to toggle the power state |
void IRKelonAc::setToggleSwingVertical | ( | const bool | toggle | ) |
Request toggling the vertical swing - will be reset to false after sending.
[in] | toggle | If true, the swing mode will be toggled when sent. |
void IRKelonAc::stateReset | ( | void | ) |
Reset the internals of the object to a known good state.
stdAc::state_t IRKelonAc::toCommon | ( | const stdAc::state_t * | prev = nullptr | ) | const |
Convert the internal A/C object state to it's stdAc::state_t equivalent.
|
static |
Convert a native fan speed to it's stdAc::fanspeed_t equivalent.
[in] | speed | A native fan speed value. |
|
static |
Convert a native mode to it's stdAc::opmode_t equivalent.
[in] | mode | A native operating mode value. |
String IRKelonAc::toString | ( | void | ) | const |
Convert the internal settings into a human readable string.
|
private |
|
private |
Instance of the IR send class.
|
private |
|
private |
|
private |