IRremoteESP8266
|
Class for handling detailed Whirlpool A/C messages. More...
#include <ir_Whirlpool.h>
Public Member Functions | |
IRWhirlpoolAc (const uint16_t pin, const bool inverted=false, const bool use_modulation=true) | |
Class constructor. More... | |
void | stateReset (void) |
Reset the state of the remote to a known good state/sequence. More... | |
void | send (const uint16_t repeat=kWhirlpoolAcDefaultRepeat, const bool calcchecksum=true) |
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 | begin (void) |
Set up hardware to be able to send a message. More... | |
void | setPowerToggle (const bool on) |
Change the power toggle setting. More... | |
bool | getPowerToggle (void) |
Get the value of the current power toggle setting. More... | |
void | setSleep (const bool on) |
Set the Sleep setting of the A/C. More... | |
bool | getSleep (void) |
Get the Sleep setting of the A/C. More... | |
void | setSuper (const bool on) |
Set the Super (Turbo/Jet) setting of the A/C. More... | |
bool | getSuper (void) |
Get the Super (Turbo/Jet) setting of the A/C. More... | |
void | setTemp (const uint8_t temp) |
Set the temperature. More... | |
uint8_t | getTemp (void) |
Get the current temperature setting. More... | |
void | setFan (const uint8_t speed) |
Set the speed of the fan. More... | |
uint8_t | getFan (void) |
Get the current fan speed setting. More... | |
void | setMode (const uint8_t mode) |
Set the operating mode of the A/C. More... | |
uint8_t | getMode (void) |
Get the operating mode setting of the A/C. More... | |
void | setSwing (const bool on) |
Set the (vertical) swing setting of the A/C. More... | |
bool | getSwing (void) |
Get the (vertical) swing setting of the A/C. More... | |
void | setLight (const bool on) |
Set the Light (Display/LED) setting of the A/C. More... | |
bool | getLight (void) |
Get the Light (Display/LED) setting of the A/C. More... | |
uint16_t | getClock (void) |
Get the clock time in nr. of minutes past midnight. More... | |
void | setClock (const uint16_t minspastmidnight) |
Set the clock time in nr. of minutes past midnight. More... | |
uint16_t | getOnTimer (void) |
Get the On Timer time.. More... | |
void | setOnTimer (const uint16_t minspastmidnight) |
Set the On Timer time. More... | |
void | enableOnTimer (const bool on) |
Enable the On Timer. More... | |
bool | isOnTimerEnabled (void) |
Is the On timer enabled? More... | |
uint16_t | getOffTimer (void) |
Get the Off Timer time.. More... | |
void | setOffTimer (const uint16_t minspastmidnight) |
Set the Off Timer time. More... | |
void | enableOffTimer (const bool on) |
Enable the Off Timer. More... | |
bool | isOffTimerEnabled (void) |
Is the Off timer enabled? More... | |
void | setCommand (const uint8_t code) |
Set the Command (Button) setting of the A/C. More... | |
uint8_t | getCommand (void) |
Get the Command (Button) setting of the A/C. More... | |
whirlpool_ac_remote_model_t | getModel (void) |
Get/Detect the model of the A/C. More... | |
void | setModel (const whirlpool_ac_remote_model_t model) |
Set the model of the A/C to emulate. More... | |
uint8_t * | getRaw (const bool calcchecksum=true) |
Get a copy of the internal state/code for this protocol. More... | |
void | setRaw (const uint8_t new_code[], const uint16_t length=kWhirlpoolAcStateLength) |
Set the internal state from a valid code for this protocol. More... | |
stdAc::state_t | toCommon (const stdAc::state_t *prev=NULL) |
Convert the current internal state into its stdAc::state_t equivilant. More... | |
String | toString (void) |
Convert the current internal state into a human readable string. More... | |
Static Public Member Functions | |
static bool | validChecksum (const uint8_t state[], const uint16_t length=kWhirlpoolAcStateLength) |
Verify the checksum is valid for a given state. More... | |
static uint8_t | convertMode (const stdAc::opmode_t mode) |
Convert a stdAc::opmode_t enum into its native mode. More... | |
static uint8_t | convertFan (const stdAc::fanspeed_t speed) |
Convert a stdAc::fanspeed_t enum into it's native speed. More... | |
static stdAc::opmode_t | toCommonMode (const uint8_t mode) |
Convert a native mode into its stdAc equivilant. More... | |
static stdAc::fanspeed_t | toCommonFanSpeed (const uint8_t speed) |
Convert a native fan speed into its stdAc equivilant. More... | |
Private Member Functions | |
void | checksum (const uint16_t length=kWhirlpoolAcStateLength) |
Calculate & set the checksum for the current internal state of the remote. More... | |
uint16_t | getTime (const uint16_t pos) |
Get the time in nr. of minutes past midnight. More... | |
void | setTime (const uint16_t pos, const uint16_t minspastmidnight) |
Set the time in nr. of minutes past midnight. More... | |
bool | isTimerEnabled (const uint16_t pos) |
Is the timer enabled at the given byte offset? More... | |
void | enableTimer (const uint16_t pos, const bool state) |
Enable the timer enabled at the given byte offset. More... | |
void | _setTemp (const uint8_t temp, const bool remember=true) |
Set the temperature. More... | |
void | _setMode (const uint8_t mode) |
Set the operating mode of the A/C. More... | |
int8_t | getTempOffset (void) |
Calculate the temp. offset in deg C for the current model. More... | |
Private Attributes | |
IRsend | _irsend |
Instance of the IR send class. More... | |
uint8_t | remote_state [kWhirlpoolAcStateLength] |
The state in IR code form. More... | |
uint8_t | _desiredtemp |
The last user explicitly set temperature. More... | |
Class for handling detailed Whirlpool A/C messages.
|
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? |
|
private |
Set the operating mode of the A/C.
[in] | mode | The desired operating mode. |
|
private |
Set the temperature.
[in] | temp | The temperature in degrees celsius. |
[in] | remember | Do we save this temperature? |
void IRWhirlpoolAc::begin | ( | void | ) |
Set up hardware to be able to send a message.
|
inline |
Run the calibration to calculate uSec timing offsets for this platform.
|
private |
Calculate & set the checksum for the current internal state of the remote.
[in] | length | The length/size of the internal state array. |
|
static |
Convert a stdAc::fanspeed_t enum into it's native speed.
[in] | speed | The enum to be converted. |
|
static |
Convert a stdAc::opmode_t enum into its native mode.
[in] | mode | The enum to be converted. |
void IRWhirlpoolAc::enableOffTimer | ( | const bool | on | ) |
Enable the Off Timer.
[in] | on | true, the timer is enabled. false, the timer is disabled. |
void IRWhirlpoolAc::enableOnTimer | ( | const bool | on | ) |
Enable the On Timer.
[in] | on | true, the timer is enabled. false, the timer is disabled. |
|
private |
Enable the timer enabled at the given byte offset.
[in] | pos | The byte offset to write to. |
[in] | on | true, the timer is enabled. false, the timer is disabled. |
uint16_t IRWhirlpoolAc::getClock | ( | void | ) |
Get the clock time in nr. of minutes past midnight.
uint8_t IRWhirlpoolAc::getCommand | ( | void | ) |
Get the Command (Button) setting of the A/C.
uint8_t IRWhirlpoolAc::getFan | ( | void | ) |
Get the current fan speed setting.
bool IRWhirlpoolAc::getLight | ( | void | ) |
Get the Light (Display/LED) setting of the A/C.
uint8_t IRWhirlpoolAc::getMode | ( | void | ) |
Get the operating mode setting of the A/C.
whirlpool_ac_remote_model_t IRWhirlpoolAc::getModel | ( | void | ) |
Get/Detect the model of the A/C.
uint16_t IRWhirlpoolAc::getOffTimer | ( | void | ) |
Get the Off Timer time..
uint16_t IRWhirlpoolAc::getOnTimer | ( | void | ) |
Get the On Timer time..
bool IRWhirlpoolAc::getPowerToggle | ( | void | ) |
Get the value of the current power toggle setting.
uint8_t * IRWhirlpoolAc::getRaw | ( | const bool | calcchecksum = true | ) |
Get a copy of the internal state/code for this protocol.
[in] | calcchecksum | Do we need to calculate the checksum?. |
bool IRWhirlpoolAc::getSleep | ( | void | ) |
Get the Sleep setting of the A/C.
bool IRWhirlpoolAc::getSuper | ( | void | ) |
Get the Super (Turbo/Jet) setting of the A/C.
bool IRWhirlpoolAc::getSwing | ( | void | ) |
Get the (vertical) swing setting of the A/C.
uint8_t IRWhirlpoolAc::getTemp | ( | void | ) |
Get the current temperature setting.
|
private |
Calculate the temp. offset in deg C for the current model.
|
private |
Get the time in nr. of minutes past midnight.
[in] | pos | The byte offset to read from. |
bool IRWhirlpoolAc::isOffTimerEnabled | ( | void | ) |
Is the Off timer enabled?
bool IRWhirlpoolAc::isOnTimerEnabled | ( | void | ) |
Is the On timer enabled?
|
private |
Is the timer enabled at the given byte offset?
[in] | pos | The byte offset to read from. |
void IRWhirlpoolAc::send | ( | const uint16_t | repeat = kWhirlpoolAcDefaultRepeat , |
const bool | calcchecksum = true |
||
) |
Send the current internal state as an IR message.
[in] | repeat | Nr. of times the message will be repeated. |
[in] | calcchecksum | Do we need to calculate the checksum?. |
void IRWhirlpoolAc::setClock | ( | const uint16_t | minspastmidnight | ) |
Set the clock time in nr. of minutes past midnight.
[in] | minspastmidnight | The time expressed as minutes past midnight. |
void IRWhirlpoolAc::setCommand | ( | const uint8_t | code | ) |
Set the Command (Button) setting of the A/C.
[in] | code | The current Command (Button) of the A/C. |
void IRWhirlpoolAc::setFan | ( | const uint8_t | speed | ) |
Set the speed of the fan.
[in] | speed | The desired setting. |
void IRWhirlpoolAc::setLight | ( | const bool | on | ) |
Set the Light (Display/LED) setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRWhirlpoolAc::setMode | ( | const uint8_t | mode | ) |
Set the operating mode of the A/C.
[in] | mode | The desired operating mode. |
void IRWhirlpoolAc::setModel | ( | const whirlpool_ac_remote_model_t | model | ) |
Set the model of the A/C to emulate.
[in] | model | The enum of the appropriate model. |
void IRWhirlpoolAc::setOffTimer | ( | const uint16_t | minspastmidnight | ) |
Set the Off Timer time.
[in] | minspastmidnight | The time expressed as minutes past midnight. |
void IRWhirlpoolAc::setOnTimer | ( | const uint16_t | minspastmidnight | ) |
Set the On Timer time.
[in] | minspastmidnight | The time expressed as minutes past midnight. |
void IRWhirlpoolAc::setPowerToggle | ( | const bool | on | ) |
Change the power toggle setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRWhirlpoolAc::setRaw | ( | const uint8_t | new_code[], |
const uint16_t | length = kWhirlpoolAcStateLength |
||
) |
Set the internal state from a valid code for this protocol.
[in] | new_code | A valid code for this protocol. |
[in] | length | The length/size of the new_code array. |
void IRWhirlpoolAc::setSleep | ( | const bool | on | ) |
Set the Sleep setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRWhirlpoolAc::setSuper | ( | const bool | on | ) |
Set the Super (Turbo/Jet) setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRWhirlpoolAc::setSwing | ( | const bool | on | ) |
Set the (vertical) swing setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRWhirlpoolAc::setTemp | ( | const uint8_t | temp | ) |
Set the temperature.
[in] | temp | The temperature in degrees celsius. |
|
private |
Set the time in nr. of minutes past midnight.
[in] | pos | The byte offset to write to. |
[in] | minspastmidnight | Nr. of minutes past midnight. |
void IRWhirlpoolAc::stateReset | ( | void | ) |
Reset the state of the remote to a known good state/sequence.
stdAc::state_t IRWhirlpoolAc::toCommon | ( | const stdAc::state_t * | prev = NULL | ) |
Convert the current internal state into its stdAc::state_t equivilant.
[in] | prev | Ptr to the previous state if required. |
|
static |
|
static |
String IRWhirlpoolAc::toString | ( | void | ) |
Convert the current internal state into a human readable string.
|
static |
Verify the checksum is valid for a given state.
[in] | state | The array to verify the checksum of. |
[in] | length | The length/size of the array. |
|
private |
The last user explicitly set temperature.
|
private |
Instance of the IR send class.
|
private |
The state in IR code form.