IRremoteESP8266
|
Class for handling detailed Gree A/C messages. More...
#include <ir_Gree.h>
Public Member Functions | |
IRGreeAC (const uint16_t pin, const gree_ac_remote_model_t model=gree_ac_remote_model_t::YAW1F, const bool inverted=false, const bool use_modulation=true) | |
Class constructor. More... | |
void | stateReset (void) |
Reset the internal state to a fixed known good state. More... | |
void | send (const uint16_t repeat=kGreeDefaultRepeat) |
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) |
Change the power setting to On. More... | |
void | off (void) |
Change the power setting to Off. More... | |
void | setModel (const gree_ac_remote_model_t model) |
Set the model of the A/C to emulate. More... | |
gree_ac_remote_model_t | getModel (void) const |
Get/Detect the model of the A/C. 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 | setTemp (const uint8_t temp, const bool fahrenheit=false) |
Set the temp. in degrees. More... | |
uint8_t | getTemp (void) const |
Get the set temperature. More... | |
void | setUseFahrenheit (const bool on) |
Set the default temperature units to use. More... | |
bool | getUseFahrenheit (void) const |
Get the default temperature units in use. More... | |
void | setFan (const uint8_t speed) |
Set the speed of the fan. More... | |
uint8_t | getFan (void) const |
Get the current fan speed setting. More... | |
void | setMode (const uint8_t new_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 | setLight (const bool on) |
Set the Light (LED) setting of the A/C. More... | |
bool | getLight (void) const |
Get the Light (LED) setting of the A/C. More... | |
void | setXFan (const bool on) |
Set the XFan (Mould) setting of the A/C. More... | |
bool | getXFan (void) const |
Get the XFan (Mould) setting of the A/C. 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... | |
void | setTurbo (const bool on) |
Set the Turbo setting of the A/C. More... | |
bool | getTurbo (void) const |
Get the Turbo setting of the A/C. More... | |
void | setIFeel (const bool on) |
Set the IFeel setting of the A/C. More... | |
bool | getIFeel (void) const |
Get the IFeel setting of the A/C. More... | |
void | setWiFi (const bool on) |
Set the Wifi (enabled) setting of the A/C. More... | |
bool | getWiFi (void) const |
Get the Wifi (enabled) setting of the A/C. More... | |
void | setSwingVertical (const bool automatic, const uint8_t position) |
Set the Vertical Swing mode of the A/C. More... | |
bool | getSwingVerticalAuto (void) const |
Get the Vertical Swing Automatic mode setting of the A/C. More... | |
uint8_t | getSwingVerticalPosition (void) const |
Get the Vertical Swing position setting of the A/C. More... | |
uint16_t | getTimer (void) const |
Get the timer time value from the A/C. More... | |
void | setTimer (const uint16_t minutes) |
Set the A/C's timer to turn off in X many minutes. More... | |
void | setDisplayTempSource (const uint8_t mode) |
Set temperature display mode. i.e. Internal, External temperature sensing. More... | |
uint8_t | getDisplayTempSource (void) const |
Get the temperature display mode. i.e. Internal, External temperature sensing. More... | |
stdAc::state_t | toCommon (void) |
Convert the current internal state into its stdAc::state_t equivalent. 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... | |
String | toString (void) |
Convert the current internal state into a human readable string. More... | |
Static Public Member Functions | |
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 uint8_t | convertSwingV (const stdAc::swingv_t swingv) |
Convert a stdAc::swingv_t enum into it's native setting. 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... | |
static stdAc::swingv_t | toCommonSwingV (const uint8_t pos) |
Convert a stdAc::swingv_t enum into it's native setting. More... | |
static bool | validChecksum (const uint8_t state[], const uint16_t length=kGreeStateLength) |
Verify the checksum is valid for a given state. More... | |
Private Member Functions | |
void | checksum (const uint16_t length=kGreeStateLength) |
Calculate and set the checksum values for the internal state. More... | |
void | fixup (void) |
Fix up the internal state so it is correct. More... | |
void | setTimerEnabled (const bool on) |
Set the timer enable setting of the A/C. More... | |
bool | getTimerEnabled (void) const |
Get the timer enabled setting of the A/C. More... | |
Private Attributes | |
IRsend | _irsend |
Instance of the IR send class. More... | |
GreeProtocol | _ |
gree_ac_remote_model_t | _model |
Class for handling detailed Gree A/C messages.
|
explicit |
Class constructor.
[in] | pin | GPIO to be used when sending. |
[in] | model | The enum of the model to be emulated. |
[in] | inverted | Is the output signal to be inverted? |
[in] | use_modulation | Is frequency modulation to be used? |
void IRGreeAC::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 and set the checksum values for the internal state.
[in] | length | The size/length of the state array to fix the checksum of. |
|
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. |
|
static |
Convert a stdAc::swingv_t enum into it's native setting.
[in] | swingv | The enum to be converted. |
|
private |
Fix up the internal state so it is correct.
uint8_t IRGreeAC::getDisplayTempSource | ( | void | ) | const |
Get the temperature display mode. i.e. Internal, External temperature sensing.
uint8_t IRGreeAC::getFan | ( | void | ) | const |
Get the current fan speed setting.
bool IRGreeAC::getIFeel | ( | void | ) | const |
Get the IFeel setting of the A/C.
bool IRGreeAC::getLight | ( | void | ) | const |
Get the Light (LED) setting of the A/C.
uint8_t IRGreeAC::getMode | ( | void | ) | const |
Get the operating mode setting of the A/C.
gree_ac_remote_model_t IRGreeAC::getModel | ( | void | ) | const |
Get/Detect the model of the A/C.
bool IRGreeAC::getPower | ( | void | ) | const |
Get the value of the current power setting.
uint8_t * IRGreeAC::getRaw | ( | void | ) |
Get a PTR to the internal state/code for this protocol.
bool IRGreeAC::getSleep | ( | void | ) | const |
Get the Sleep setting of the A/C.
bool IRGreeAC::getSwingVerticalAuto | ( | void | ) | const |
Get the Vertical Swing Automatic mode setting of the A/C.
uint8_t IRGreeAC::getSwingVerticalPosition | ( | void | ) | const |
Get the Vertical Swing position setting of the A/C.
uint8_t IRGreeAC::getTemp | ( | void | ) | const |
Get the set temperature.
uint16_t IRGreeAC::getTimer | ( | void | ) | const |
Get the timer time value from the A/C.
|
private |
Get the timer enabled setting of the A/C.
bool IRGreeAC::getTurbo | ( | void | ) | const |
Get the Turbo setting of the A/C.
bool IRGreeAC::getUseFahrenheit | ( | void | ) | const |
Get the default temperature units in use.
bool IRGreeAC::getWiFi | ( | void | ) | const |
Get the Wifi (enabled) setting of the A/C.
bool IRGreeAC::getXFan | ( | void | ) | const |
Get the XFan (Mould) setting of the A/C.
void IRGreeAC::off | ( | void | ) |
Change the power setting to Off.
void IRGreeAC::on | ( | void | ) |
Change the power setting to On.
void IRGreeAC::send | ( | const uint16_t | repeat = kGreeDefaultRepeat | ) |
Send the current internal state as an IR message.
[in] | repeat | Nr. of times the message will be repeated. |
void IRGreeAC::setDisplayTempSource | ( | const uint8_t | mode | ) |
Set temperature display mode. i.e. Internal, External temperature sensing.
[in] | mode | The desired temp source to display. |
void IRGreeAC::setFan | ( | const uint8_t | speed | ) |
Set the speed of the fan.
[in] | speed | The desired setting. 0 is auto, 1-3 is the speed. |
void IRGreeAC::setIFeel | ( | const bool | on | ) |
Set the IFeel setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRGreeAC::setLight | ( | const bool | on | ) |
Set the Light (LED) setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRGreeAC::setMode | ( | const uint8_t | new_mode | ) |
Set the operating mode of the A/C.
[in] | new_mode | The desired operating mode. |
void IRGreeAC::setModel | ( | const gree_ac_remote_model_t | model | ) |
Set the model of the A/C to emulate.
[in] | model | The enum of the appropriate model. |
void IRGreeAC::setPower | ( | const bool | on | ) |
Change the power setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRGreeAC::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 IRGreeAC::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 IRGreeAC::setSwingVertical | ( | const bool | automatic, |
const uint8_t | position | ||
) |
Set the Vertical Swing mode of the A/C.
[in] | automatic | Do we use the automatic setting? |
[in] | position | The position/mode to set the vanes to. |
void IRGreeAC::setTemp | ( | const uint8_t | temp, |
const bool | fahrenheit = false |
||
) |
Set the temp. in degrees.
[in] | temp | Desired temperature in Degrees. |
[in] | fahrenheit | Use units of Fahrenheit and set that as units used. false is Celsius (Default), true is Fahrenheit. |
void IRGreeAC::setTimer | ( | const uint16_t | minutes | ) |
Set the A/C's timer to turn off in X many minutes.
[in] | minutes | The number of minutes the timer should be set for. |
|
private |
Set the timer enable setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRGreeAC::setTurbo | ( | const bool | on | ) |
Set the Turbo setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRGreeAC::setUseFahrenheit | ( | const bool | on | ) |
Set the default temperature units to use.
[in] | on | Use Fahrenheit as the units. true is Fahrenheit, false is Celsius. |
void IRGreeAC::setWiFi | ( | const bool | on | ) |
Set the Wifi (enabled) setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRGreeAC::setXFan | ( | const bool | on | ) |
Set the XFan (Mould) setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRGreeAC::stateReset | ( | void | ) |
Reset the internal state to a fixed known good state.
stdAc::state_t IRGreeAC::toCommon | ( | void | ) |
Convert the current internal state into its stdAc::state_t equivalent.
|
static |
|
static |
|
static |
Convert a stdAc::swingv_t enum into it's native setting.
[in] | pos | The enum to be converted. |
String IRGreeAC::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 |
|
private |
Instance of the IR send class.
|
private |