IRremoteESP8266
|
Class for handling detailed Coolix A/C messages. More...
#include <ir_Coolix.h>
Public Member Functions | |
IRCoolixAC (const uint16_t pin, const bool inverted=false, const bool use_modulation=true) | |
Class constructor. More... | |
void | stateReset () |
Reset the internal state to a fixed known good state. More... | |
void | send (const uint16_t repeat=kCoolixDefaultRepeat) |
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 | on () |
Change the power setting to On. More... | |
void | off () |
Change the power setting to Off. More... | |
void | setPower (const bool state) |
Change the power setting. More... | |
bool | getPower () |
Get the value of the current power setting. More... | |
void | setTemp (const uint8_t temp) |
Set the temperature. More... | |
uint8_t | getTemp () |
Get the current temperature setting. More... | |
void | setSensorTemp (const uint8_t desired) |
Set the sensor temperature. More... | |
uint8_t | getSensorTemp () |
Get the sensor temperature setting. More... | |
void | clearSensorTemp () |
Clear the Sensor Temperature setting.. More... | |
void | setFan (const uint8_t speed, const bool modecheck=true) |
Set the speed of the fan. More... | |
uint8_t | getFan () |
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 () |
Get the operating mode setting of the A/C. More... | |
void | setSwing () |
Toggle the Swing mode of the A/C. More... | |
bool | getSwing () |
Get the Swing setting of the A/C. More... | |
void | setSleep () |
Toggle the Sleep mode of the A/C. More... | |
bool | getSleep () |
Get the Sleep setting of the A/C. More... | |
void | setTurbo () |
Toggle the Turbo mode of the A/C. More... | |
bool | getTurbo () |
Get the Turbo setting of the A/C. More... | |
void | setLed () |
Toggle the Led (light) mode of the A/C. More... | |
bool | getLed () |
Get the Led (light) setting of the A/C. More... | |
void | setClean () |
Toggle the Clean mode of the A/C. More... | |
bool | getClean () |
Get the Clean setting of the A/C. More... | |
bool | getZoneFollow () |
Get the Zone Follow setting of the A/C. More... | |
uint32_t | getRaw () |
Get a copy of the internal state as a valid code for this protocol. More... | |
void | setRaw (const uint32_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 standard A/C mode 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 A/C state to it's common stdAc::state_t equivalent. More... | |
String | toString () |
Convert the internal state into a human readable string. More... | |
Static Public Member Functions | |
static stdAc::opmode_t | toCommonMode (const uint8_t mode) |
Convert a native mode to it's common stdAc::opmode_t equivalent. More... | |
static stdAc::fanspeed_t | toCommonFanSpeed (const uint8_t speed) |
Convert a native fan speed into its stdAc equivilant. More... | |
Private Member Functions | |
void | setTempRaw (const uint8_t code) |
Set the raw (native) temperature value. More... | |
uint8_t | getTempRaw () |
Get the raw (native) temperature value. More... | |
void | setSensorTempRaw (const uint8_t code) |
Set the raw (native) sensor temperature value. More... | |
void | setZoneFollow (const bool on) |
Change the Zone Follow setting. More... | |
bool | isSpecialState (void) |
Is the current state is a special state? More... | |
bool | handleSpecialState (const uint32_t data) |
Adjust any internal settings based on the type of special state we are supplied. Does nothing if it isn't a special state. More... | |
void | updateSavedState (void) |
Backup the current internal state as long as it isn't a special state. More... | |
void | recoverSavedState (void) |
Restore the current internal state from backup as long as it isn't a special state. More... | |
uint32_t | getNormalState (void) |
Private Attributes | |
IRsend | _irsend |
Instance of the IR send class. More... | |
bool | powerFlag |
bool | turboFlag |
bool | ledFlag |
bool | cleanFlag |
bool | sleepFlag |
bool | zoneFollowFlag |
bool | swingFlag |
bool | swingHFlag |
bool | swingVFlag |
uint32_t | remote_state |
The state of the IR remote in IR code form. More... | |
uint32_t | saved_state |
Copy of the state if we required a special mode. More... | |
Class for handling detailed Coolix 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 IRCoolixAC::begin | ( | ) |
Set up hardware to be able to send a message.
|
inline |
Run the calibration to calculate uSec timing offsets for this platform.
void IRCoolixAC::clearSensorTemp | ( | ) |
Clear the Sensor Temperature setting..
uint8_t IRCoolixAC::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 IRCoolixAC::convertMode | ( | const stdAc::opmode_t | mode | ) |
Convert a standard A/C mode into its native mode.
[in] | mode | A stdAc::opmode_t to be converted to it's native equivalent. |
bool IRCoolixAC::getClean | ( | ) |
Get the Clean setting of the A/C.
uint8_t IRCoolixAC::getFan | ( | ) |
Get the current fan speed setting.
bool IRCoolixAC::getLed | ( | ) |
Get the Led (light) setting of the A/C.
uint8_t IRCoolixAC::getMode | ( | ) |
Get the operating mode setting of the A/C.
|
private |
bool IRCoolixAC::getPower | ( | ) |
Get the value of the current power setting.
uint32_t IRCoolixAC::getRaw | ( | ) |
Get a copy of the internal state as a valid code for this protocol.
uint8_t IRCoolixAC::getSensorTemp | ( | ) |
Get the sensor temperature setting.
bool IRCoolixAC::getSleep | ( | ) |
Get the Sleep setting of the A/C.
bool IRCoolixAC::getSwing | ( | ) |
Get the Swing setting of the A/C.
uint8_t IRCoolixAC::getTemp | ( | ) |
Get the current temperature setting.
|
private |
Get the raw (native) temperature value.
bool IRCoolixAC::getTurbo | ( | ) |
Get the Turbo setting of the A/C.
bool IRCoolixAC::getZoneFollow | ( | ) |
Get the Zone Follow setting of the A/C.
|
private |
Adjust any internal settings based on the type of special state we are supplied. Does nothing if it isn't a special state.
[in] | data | The state we need to act upon. |
|
private |
Is the current state is a special state?
void IRCoolixAC::off | ( | ) |
Change the power setting to Off.
void IRCoolixAC::on | ( | ) |
Change the power setting to On.
|
private |
Restore the current internal state from backup as long as it isn't a special state.
void IRCoolixAC::send | ( | const uint16_t | repeat = kCoolixDefaultRepeat | ) |
Send the current internal state as an IR message.
[in] | repeat | Nr. of times the message will be repeated. |
void IRCoolixAC::setClean | ( | ) |
Toggle the Clean mode of the A/C.
void IRCoolixAC::setFan | ( | const uint8_t | speed, |
const bool | modecheck = true |
||
) |
Set the speed of the fan.
[in] | speed | The desired setting. |
[in] | modecheck | Do we enforce any mode limitations before setting? |
void IRCoolixAC::setLed | ( | ) |
Toggle the Led (light) mode of the A/C.
void IRCoolixAC::setMode | ( | const uint8_t | mode | ) |
Set the operating mode of the A/C.
[in] | mode | The desired operating mode. |
void IRCoolixAC::setPower | ( | const bool | on | ) |
Change the power setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRCoolixAC::setRaw | ( | const uint32_t | new_code | ) |
Set the internal state from a valid code for this protocol.
[in] | new_code | A valid code for this protocol. |
void IRCoolixAC::setSensorTemp | ( | const uint8_t | desired | ) |
Set the sensor temperature.
[in] | desired | The temperature in degrees celsius. |
|
private |
Set the raw (native) sensor temperature value.
[in] | code | The desired native sensor temperature. |
void IRCoolixAC::setSleep | ( | ) |
Toggle the Sleep mode of the A/C.
void IRCoolixAC::setSwing | ( | ) |
Toggle the Swing mode of the A/C.
void IRCoolixAC::setTemp | ( | const uint8_t | desired | ) |
Set the temperature.
[in] | desired | The temperature in degrees celsius. |
|
private |
Set the raw (native) temperature value.
[in] | code | The desired native temperature. |
void IRCoolixAC::setTurbo | ( | ) |
Toggle the Turbo mode of the A/C.
|
private |
Change the Zone Follow setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRCoolixAC::stateReset | ( | ) |
Reset the internal state to a fixed known good state.
stdAc::state_t IRCoolixAC::toCommon | ( | const stdAc::state_t * | prev = NULL | ) |
Convert the A/C state to it's common stdAc::state_t equivalent.
[in] | prev | Ptr to the previous state if required. |
|
static |
|
static |
Convert a native mode to it's common stdAc::opmode_t equivalent.
[in] | mode | A native operation mode to be converted. |
String IRCoolixAC::toString | ( | ) |
Convert the internal state into a human readable string.
|
private |
Backup the current internal state as long as it isn't a special state.
|
private |
Instance of the IR send class.
|
private |
|
private |
|
private |
|
private |
The state of the IR remote in IR code form.
|
private |
Copy of the state if we required a special mode.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |