IRremoteESP8266
|
Class for handling detailed Voltas A/C messages. More...
#include <ir_Voltas.h>
Public Member Functions | |
IRVoltas (const uint16_t pin, const bool inverted=false, const bool use_modulation=true) | |
Class constructor. More... | |
void | stateReset () |
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 | begin () |
Set up hardware to be able to send a message. More... | |
void | setModel (const voltas_ac_remote_model_t model) |
Set the current model for the remote. More... | |
voltas_ac_remote_model_t | getModel (const bool raw=false) const |
Get the model information currently known. More... | |
void | setPower (const bool on) |
Change the power setting. More... | |
bool | getPower (void) const |
Get the value of the current power setting. More... | |
void | on (void) |
Change the power setting to On. More... | |
void | off (void) |
Change the power setting to Off. More... | |
void | setWifi (const bool on) |
Change the Wifi setting. More... | |
bool | getWifi (void) const |
Get the value of the current Wifi setting. 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 | setSwingH (const bool on) |
Set the Horizontal Swing setting of the A/C. More... | |
bool | getSwingH (void) const |
Get the Horizontal Swing setting of the A/C. More... | |
void | setSwingHChange (const bool on) |
Set the bits for changing the Horizontal Swing setting of the A/C. More... | |
bool | getSwingHChange (void) const |
Are the Horizontal Swing change bits set in the message? More... | |
void | setSwingV (const bool on) |
Set the Vertical Swing setting of the A/C. More... | |
bool | getSwingV (void) const |
Get the Vertical Swing setting of the A/C. More... | |
void | setEcono (const bool on) |
Change the Economy setting. More... | |
bool | getEcono (void) const |
Get the value of the current Econo setting. More... | |
void | setLight (const bool on) |
Change the Light setting. More... | |
bool | getLight (void) const |
Get the value of the current Light setting. More... | |
void | setTurbo (const bool on) |
Change the Turbo setting. More... | |
bool | getTurbo (void) const |
Get the value of the current Turbo setting. More... | |
void | setSleep (const bool on) |
Change the Sleep setting. More... | |
bool | getSleep (void) const |
Get the value of the current Sleep setting. More... | |
uint16_t | getOnTime (void) const |
Get the value of the On Timer time. More... | |
void | setOnTime (const uint16_t nr_of_mins) |
Set the value of the On Timer time. More... | |
uint16_t | getOffTime (void) const |
Get the value of the On Timer time. More... | |
void | setOffTime (const uint16_t nr_of_mins) |
Set the value of the Off Timer time. More... | |
uint8_t * | getRaw (void) |
Get a PTR to the internal state/code for this protocol. More... | |
void | setRaw (const uint8_t new_code[]) |
Set the internal state from a valid code for this protocol. More... | |
uint8_t | convertMode (const stdAc::opmode_t mode) |
Convert a stdAc::opmode_t enum into its native mode. More... | |
uint8_t | convertFan (const stdAc::fanspeed_t speed) |
Convert a stdAc::fanspeed_t enum into it's native speed. More... | |
stdAc::state_t | toCommon (const stdAc::state_t *prev=NULL) |
Convert the current internal state into its stdAc::state_t equivalent. 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=kVoltasStateLength) |
Verify the checksum is valid for a given state. More... | |
static stdAc::opmode_t | toCommonMode (const uint8_t mode) |
Convert a native mode into its stdAc equivalent. More... | |
static stdAc::fanspeed_t | toCommonFanSpeed (const uint8_t speed) |
Convert a native fan speed into its stdAc equivalent. More... | |
Private Member Functions | |
void | checksum (void) |
Calculate and set the checksum values for the internal state. More... | |
Static Private Member Functions | |
static uint8_t | calcChecksum (const uint8_t state[], const uint16_t length=kVoltasStateLength) |
Calculate the checksum is valid for a given state. More... | |
Private Attributes | |
IRsend | _irsend |
Instance of the IR send class. More... | |
VoltasProtocol | _ |
The state of the IR remote. More... | |
voltas_ac_remote_model_t | _model |
Model type. More... | |
Class for handling detailed Voltas 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? |
void IRVoltas::begin | ( | ) |
Set up hardware to be able to send a message.
|
staticprivate |
Calculate the checksum is valid for a given state.
[in] | state | The array to calculate the checksum of. |
[in] | length | The length of the state array. |
|
inline |
Run the calibration to calculate uSec timing offsets for this platform.
|
private |
Calculate and set the checksum values for the internal state.
uint8_t IRVoltas::convertFan | ( | const stdAc::fanspeed_t | speed | ) |
Convert a stdAc::fanspeed_t enum into it's native speed.
[in] | speed | The enum to be converted. |
uint8_t IRVoltas::convertMode | ( | const stdAc::opmode_t | mode | ) |
Convert a stdAc::opmode_t enum into its native mode.
[in] | mode | The enum to be converted. |
bool IRVoltas::getEcono | ( | void | ) | const |
Get the value of the current Econo setting.
uint8_t IRVoltas::getFan | ( | void | ) |
Get the current fan speed setting.
bool IRVoltas::getLight | ( | void | ) | const |
Get the value of the current Light setting.
uint8_t IRVoltas::getMode | ( | void | ) |
Get the operating mode setting of the A/C.
voltas_ac_remote_model_t IRVoltas::getModel | ( | const bool | raw = false | ) | const |
Get the model information currently known.
[in] | raw | Work out the model info from the current raw state. |
uint16_t IRVoltas::getOffTime | ( | void | ) | const |
Get the value of the On Timer time.
uint16_t IRVoltas::getOnTime | ( | void | ) | const |
Get the value of the On Timer time.
bool IRVoltas::getPower | ( | void | ) | const |
Get the value of the current power setting.
uint8_t * IRVoltas::getRaw | ( | void | ) |
Get a PTR to the internal state/code for this protocol.
bool IRVoltas::getSleep | ( | void | ) | const |
Get the value of the current Sleep setting.
bool IRVoltas::getSwingH | ( | void | ) | const |
Get the Horizontal Swing setting of the A/C.
bool IRVoltas::getSwingHChange | ( | void | ) | const |
Are the Horizontal Swing change bits set in the message?
bool IRVoltas::getSwingV | ( | void | ) | const |
Get the Vertical Swing setting of the A/C.
uint8_t IRVoltas::getTemp | ( | void | ) |
Get the current temperature setting.
bool IRVoltas::getTurbo | ( | void | ) | const |
Get the value of the current Turbo setting.
bool IRVoltas::getWifi | ( | void | ) | const |
Get the value of the current Wifi setting.
void IRVoltas::off | ( | void | ) |
Change the power setting to Off.
void IRVoltas::on | ( | void | ) |
Change the power setting to On.
void IRVoltas::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 IRVoltas::setEcono | ( | const bool | on | ) |
Change the Economy setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRVoltas::setFan | ( | const uint8_t | fan | ) |
Set the speed of the fan.
[in] | fan | The desired setting. |
void IRVoltas::setLight | ( | const bool | on | ) |
Change the Light setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRVoltas::setMode | ( | const uint8_t | mode | ) |
Set the operating mode of the A/C.
[in] | mode | The desired operating mode. |
void IRVoltas::setModel | ( | const voltas_ac_remote_model_t | model | ) |
Set the current model for the remote.
[in] | model | The model number. |
void IRVoltas::setOffTime | ( | const uint16_t | nr_of_mins | ) |
Set the value of the Off Timer time.
[in] | nr_of_mins | Number of minutes before the timer activates. 0 disables the timer. Max is 23 hrs & 59 mins (1439 mins) |
void IRVoltas::setOnTime | ( | const uint16_t | nr_of_mins | ) |
Set the value of the On Timer time.
[in] | nr_of_mins | Number of minutes before the timer activates. 0 disables the timer. Max is 23 hrs & 59 mins (1439 mins) |
void IRVoltas::setPower | ( | const bool | on | ) |
Change the power setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRVoltas::setRaw | ( | const uint8_t | new_code[] | ) |
Set the internal state from a valid code for this protocol.
[in] | new_code | A valid code for this protocol. |
void IRVoltas::setSleep | ( | const bool | on | ) |
Change the Sleep setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRVoltas::setSwingH | ( | const bool | on | ) |
Set the Horizontal Swing setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRVoltas::setSwingHChange | ( | const bool | on | ) |
Set the bits for changing the Horizontal Swing setting of the A/C.
[in] | on | true, the change bits are set. false, the "no change" bits are set. |
void IRVoltas::setSwingV | ( | 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 IRVoltas::setTemp | ( | const uint8_t | temp | ) |
Set the temperature.
[in] | temp | The temperature in degrees celsius. |
void IRVoltas::setTurbo | ( | const bool | on | ) |
Change the Turbo setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRVoltas::setWifi | ( | const bool | on | ) |
Change the Wifi setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRVoltas::stateReset | ( | ) |
stdAc::state_t IRVoltas::toCommon | ( | const stdAc::state_t * | prev = NULL | ) |
Convert the current internal state into its stdAc::state_t equivalent.
[in] | prev | Ptr to the previous state if available. |
|
static |
|
static |
String IRVoltas::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 of the state array. |
|
private |
The state of the IR remote.
|
private |
Instance of the IR send class.
|
private |
Model type.