IRremoteESP8266
|
Class for handling detailed Midea A/C messages. More...
#include <ir_Midea.h>
Public Member Functions | |
IRMideaAC (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=kMideaMinRepeat) |
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 | on (void) |
Set the requested power state of the A/C to on. More... | |
void | off (void) |
Set the requested power state of the A/C to off. More... | |
void | setPower (const bool on) |
Change the power setting. More... | |
bool | getPower (void) const |
Get the value of the current power setting. More... | |
bool | getUseCelsius (void) const |
Is the device currently using Celsius or the Fahrenheit temp scale? More... | |
void | setUseCelsius (const bool celsius) |
Set the A/C unit to use Celsius natively. More... | |
void | setTemp (const uint8_t temp, const bool useCelsius=false) |
Set the temperature. More... | |
uint8_t | getTemp (const bool useCelsius=false) const |
Get the current temperature setting. More... | |
void | setFan (const uint8_t fan) |
Set the speed of the fan. More... | |
uint8_t | getFan (void) const |
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) const |
Get the operating mode setting of the A/C. More... | |
void | setRaw (const uint64_t newState) |
Set the internal state from a valid code for this protocol. More... | |
uint64_t | getRaw (void) |
Get a copy of the internal state/code for this protocol. More... | |
void | setSleep (const bool on) |
Set the Sleep setting of the A/C. More... | |
bool | getSleep (void) const |
Get the Sleep setting of the A/C. More... | |
bool | isSwingVToggle (void) const |
Is the current state a vertical swing toggle message? More... | |
void | setSwingVToggle (const bool on) |
Set the A/C to toggle the vertical swing toggle for the next send. More... | |
bool | getSwingVToggle (void) |
bool | isEconoToggle (void) const |
Is the current state an Econo (energy saver) toggle message? More... | |
void | setEconoToggle (const bool on) |
Set the A/C to toggle the Econo (energy saver) mode for the next send. More... | |
bool | getEconoToggle (void) |
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 uint64_t state) |
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 (void) |
Calculate & set the checksum for the current internal state of the remote. More... | |
Static Private Member Functions | |
static uint8_t | calcChecksum (const uint64_t state) |
Calculate the checksum for a given state. More... | |
Private Attributes | |
IRsend | _irsend |
Instance of the IR send class. More... | |
MideaProtocol | _ |
bool | _SwingVToggle |
bool | _EconoToggle |
Class for handling detailed Midea 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 IRMideaAC::begin | ( | void | ) |
Set up hardware to be able to send a message.
|
staticprivate |
Calculate the checksum for a given state.
[in] | state | The value to calc the checksum of. |
|
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.
|
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. |
bool IRMideaAC::getEconoToggle | ( | void | ) |
uint8_t IRMideaAC::getFan | ( | void | ) | const |
Get the current fan speed setting.
uint8_t IRMideaAC::getMode | ( | void | ) | const |
Get the operating mode setting of the A/C.
bool IRMideaAC::getPower | ( | void | ) | const |
Get the value of the current power setting.
uint64_t IRMideaAC::getRaw | ( | void | ) |
Get a copy of the internal state/code for this protocol.
bool IRMideaAC::getSleep | ( | void | ) | const |
Get the Sleep setting of the A/C.
bool IRMideaAC::getSwingVToggle | ( | void | ) |
uint8_t IRMideaAC::getTemp | ( | const bool | celsius = false | ) | const |
Get the current temperature setting.
[in] | celsius | true, the results are in Celsius. false, in Fahrenheit. |
bool IRMideaAC::getUseCelsius | ( | void | ) | const |
Is the device currently using Celsius or the Fahrenheit temp scale?
bool IRMideaAC::isEconoToggle | ( | void | ) | const |
Is the current state an Econo (energy saver) toggle message?
bool IRMideaAC::isSwingVToggle | ( | void | ) | const |
Is the current state a vertical swing toggle message?
void IRMideaAC::off | ( | void | ) |
Set the requested power state of the A/C to off.
void IRMideaAC::on | ( | void | ) |
Set the requested power state of the A/C to on.
void IRMideaAC::send | ( | const uint16_t | repeat = kMideaMinRepeat | ) |
Send the current internal state as an IR message.
[in] | repeat | Nr. of times the message will be repeated. |
void IRMideaAC::setEconoToggle | ( | const bool | on | ) |
Set the A/C to toggle the Econo (energy saver) mode for the next send.
[in] | on | true, the setting is on. false, the setting is off. |
void IRMideaAC::setFan | ( | const uint8_t | fan | ) |
Set the speed of the fan.
[in] | fan | The desired setting. 1-3 set the speed, 0 for auto. |
void IRMideaAC::setMode | ( | const uint8_t | mode | ) |
Set the operating mode of the A/C.
[in] | mode | The desired operating mode. |
void IRMideaAC::setPower | ( | const bool | on | ) |
Change the power setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRMideaAC::setRaw | ( | const uint64_t | newState | ) |
Set the internal state from a valid code for this protocol.
[in] | newState | A valid code for this protocol. |
void IRMideaAC::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 IRMideaAC::setSwingVToggle | ( | const bool | on | ) |
Set the A/C to toggle the vertical swing toggle for the next send.
[in] | on | true, the setting is on. false, the setting is off. |
void IRMideaAC::setTemp | ( | const uint8_t | temp, |
const bool | useCelsius = false |
||
) |
Set the temperature.
[in] | temp | The temperature in degrees celsius. |
[in] | useCelsius | true, use the Celsius temp scale. false, is Fahrenheit |
void IRMideaAC::setUseCelsius | ( | const bool | on | ) |
Set the A/C unit to use Celsius natively.
[in] | on | true, the setting is on. false, the setting is off. |
void IRMideaAC::stateReset | ( | void | ) |
Reset the state of the remote to a known good state/sequence.
stdAc::state_t IRMideaAC::toCommon | ( | const stdAc::state_t * | prev = NULL | ) |
Convert the current internal state into its stdAc::state_t equivilant.
[in] | prev | A Ptr to the previous state. |
|
static |
|
static |
String IRMideaAC::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 state to verify the checksum of. |
|
private |
|
private |
|
private |
Instance of the IR send class.
|
private |