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 | setSensorTemp (const uint8_t temp, const bool useCelsius=false) |
Set the Sensor temperature. More... | |
uint8_t | getSensorTemp (const bool useCelsius=false) const |
Get the current Sensor temperature setting. More... | |
void | setEnableSensorTemp (const bool on) |
Enable the remote's Sensor temperature. More... | |
bool | getEnableSensorTemp (void) const |
Is the remote temperature sensor enabled? 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 | isSwingVStep (void) const |
Is the current state a step vertical swing message? More... | |
void | setSwingVStep (const bool on) |
Set the A/C to step the vertical swing for the next send. More... | |
bool | getSwingVStep (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) |
bool | isTurboToggle (void) const |
Is the current state a Turbo toggle message? More... | |
void | setTurboToggle (const bool on) |
Set the A/C to toggle the Turbo mode for the next send. More... | |
bool | getTurboToggle (void) |
bool | isLightToggle (void) const |
Is the current state a Light (LED) toggle message? More... | |
void | setLightToggle (const bool on) |
Set the A/C to toggle the Light (LED) mode for the next send. More... | |
bool | getLightToggle (void) |
uint8_t | getType (void) const |
Get the message type setting of the A/C message. More... | |
bool | isOnTimerEnabled (void) const |
Is the OnTimer enabled? More... | |
uint16_t | getOnTimer (void) const |
Get the value of the OnTimer is currently set to. More... | |
void | setOnTimer (const uint16_t mins) |
Set the value of the On Timer. More... | |
bool | isOffTimerEnabled (void) const |
Is the OffTimer enabled? More... | |
uint16_t | getOffTimer (void) const |
Get the value of the OffTimer is currently set to. More... | |
void | setOffTimer (const uint16_t mins) |
Set the value of the Off Timer. 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 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 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 & set the checksum for the current internal state of the remote. More... | |
void | setType (const uint8_t type) |
Set the message type setting of the A/C message. 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 | _SwingVStep |
bool | _EconoToggle |
bool | _TurboToggle |
bool | _LightToggle |
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 | ) |
bool IRMideaAC::getEnableSensorTemp | ( | void | ) | const |
Is the remote temperature sensor enabled?
uint8_t IRMideaAC::getFan | ( | void | ) | const |
Get the current fan speed setting.
bool IRMideaAC::getLightToggle | ( | void | ) |
uint8_t IRMideaAC::getMode | ( | void | ) | const |
Get the operating mode setting of the A/C.
uint16_t IRMideaAC::getOffTimer | ( | void | ) | const |
Get the value of the OffTimer is currently set to.
uint16_t IRMideaAC::getOnTimer | ( | void | ) | const |
Get the value of the OnTimer is currently set to.
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.
uint8_t IRMideaAC::getSensorTemp | ( | const bool | celsius = false | ) | const |
Get the current Sensor temperature setting.
[in] | celsius | true, the results are in Celsius. false, in Fahrenheit. |
bool IRMideaAC::getSleep | ( | void | ) | const |
Get the Sleep setting of the A/C.
bool IRMideaAC::getSwingVStep | ( | void | ) |
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::getTurboToggle | ( | void | ) |
uint8_t IRMideaAC::getType | ( | void | ) | const |
Get the message type setting of the A/C message.
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::isLightToggle | ( | void | ) | const |
Is the current state a Light (LED) toggle message?
bool IRMideaAC::isOffTimerEnabled | ( | void | ) | const |
Is the OffTimer enabled?
bool IRMideaAC::isOnTimerEnabled | ( | void | ) | const |
Is the OnTimer enabled?
bool IRMideaAC::isSwingVStep | ( | void | ) | const |
Is the current state a step vertical swing message?
bool IRMideaAC::isSwingVToggle | ( | void | ) | const |
Is the current state a vertical swing toggle message?
bool IRMideaAC::isTurboToggle | ( | void | ) | const |
Is the current state a Turbo 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::setEnableSensorTemp | ( | const bool | on | ) |
Enable the remote's Sensor temperature.
[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::setLightToggle | ( | const bool | on | ) |
Set the A/C to toggle the Light (LED) mode for the next send.
[in] | on | true, the setting is on. false, the setting is off. |
void IRMideaAC::setMode | ( | const uint8_t | mode | ) |
Set the operating mode of the A/C.
[in] | mode | The desired operating mode. |
void IRMideaAC::setOffTimer | ( | const uint16_t | mins | ) |
Set the value of the Off Timer.
[in] | mins | The number of minutes for the timer. |
void IRMideaAC::setOnTimer | ( | const uint16_t | mins | ) |
Set the value of the On Timer.
[in] | mins | The number of minutes for the timer. |
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::setSensorTemp | ( | const uint8_t | temp, |
const bool | useCelsius = false |
||
) |
Set the Sensor temperature.
[in] | temp | The temperature in degrees celsius. |
[in] | useCelsius | true, use the Celsius temp scale. false, is Fahrenheit |
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::setSwingVStep | ( | const bool | on | ) |
Set the A/C to step the vertical swing for the next send.
[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::setTurboToggle | ( | const bool | on | ) |
Set the A/C to toggle the Turbo mode for the next send.
[in] | on | true, the setting is on. false, the setting is off. |
|
private |
Set the message type setting of the A/C message.
[in] | setting | The desired message type setting. |
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 equivalent.
[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 |
|
private |
|
private |
|
private |