IRremoteESP8266
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
IRGoodweatherAc Class Reference

Class for handling detailed Goodweather A/C messages. More...

#include <ir_Goodweather.h>

Collaboration diagram for IRGoodweatherAc:
Collaboration graph
[legend]

Public Member Functions

 IRGoodweatherAc (const uint16_t pin, 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=kGoodweatherMinRepeat)
 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 setPower (const bool on)
 Change the power setting. More...
 
bool getPower (void)
 Get the value of the current power 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 ()
 Get the operating mode setting of the A/C. More...
 
void setSwing (const uint8_t speed)
 Set the Vertical Swing speed of the A/C. More...
 
uint8_t getSwing (void)
 Get the Vertical Swing speed of the A/C. More...
 
void setSleep (const bool toggle)
 Set the Sleep Toggle setting of the A/C. More...
 
bool getSleep (void)
 Get the Sleep Toggle setting of the A/C. More...
 
void setTurbo (const bool toggle)
 Set the Turbo Toggle setting of the A/C. More...
 
bool getTurbo (void)
 Get the Turbo Toggle setting of the A/C. More...
 
void setLight (const bool toggle)
 Set the Light (LED) Toggle setting of the A/C. More...
 
bool getLight (void)
 Get the Light (LED) Toggle setting of the A/C. More...
 
void setCommand (const uint8_t cmd)
 Set the remote Command type/button pressed. More...
 
uint8_t getCommand (void)
 Get the Command type/button pressed from the current settings. More...
 
uint64_t getRaw (void)
 Get a copy of the internal state as a valid code for this protocol. More...
 
void setRaw (const uint64_t state)
 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...
 
uint8_t convertSwingV (const stdAc::swingv_t swingv)
 Convert a stdAc::swingv_t enum into it's native setting. More...
 
stdAc::state_t toCommon (void)
 Convert the current internal state into its stdAc::state_t equivilant. More...
 
String toString ()
 Convert the current 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 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 Attributes

IRsend _irsend
 Instance of the IR send class. More...
 
uint64_t remote
 The state of the IR remote in IR code form. More...
 

Detailed Description

Class for handling detailed Goodweather A/C messages.

Constructor & Destructor Documentation

◆ IRGoodweatherAc()

IRGoodweatherAc::IRGoodweatherAc ( const uint16_t  pin,
const bool  inverted = false,
const bool  use_modulation = true 
)
explicit

Class constructor.

Parameters
[in]pinGPIO to be used when sending.
[in]invertedIs the output signal to be inverted?
[in]use_modulationIs frequency modulation to be used?

Member Function Documentation

◆ begin()

void IRGoodweatherAc::begin ( void  )

Set up hardware to be able to send a message.

◆ calibrate()

int8_t IRGoodweatherAc::calibrate ( void  )
inline

Run the calibration to calculate uSec timing offsets for this platform.

Returns
The uSec timing offset needed per modulation of the IR Led.
Note
This will produce a 65ms IR signal pulse at 38kHz. Only ever needs to be run once per object instantiation, if at all.

◆ convertFan()

uint8_t IRGoodweatherAc::convertFan ( const stdAc::fanspeed_t  speed)

Convert a stdAc::fanspeed_t enum into it's native speed.

Parameters
[in]speedThe enum to be converted.
Returns
The native equivilant of the enum.

◆ convertMode()

uint8_t IRGoodweatherAc::convertMode ( const stdAc::opmode_t  mode)

Convert a stdAc::opmode_t enum into its native mode.

Parameters
[in]modeThe enum to be converted.
Returns
The native equivilant of the enum.

◆ convertSwingV()

uint8_t IRGoodweatherAc::convertSwingV ( const stdAc::swingv_t  swingv)

Convert a stdAc::swingv_t enum into it's native setting.

Parameters
[in]swingvThe enum to be converted.
Returns
The native equivilant of the enum.

◆ getCommand()

uint8_t IRGoodweatherAc::getCommand ( void  )

Get the Command type/button pressed from the current settings.

Returns
The command/button that was issued/pressed.

◆ getFan()

uint8_t IRGoodweatherAc::getFan ( void  )

Get the current fan speed setting.

Returns
The current fan speed.

◆ getLight()

bool IRGoodweatherAc::getLight ( void  )

Get the Light (LED) Toggle setting of the A/C.

Returns
true, the setting is on. false, the setting is off.

◆ getMode()

uint8_t IRGoodweatherAc::getMode ( )

Get the operating mode setting of the A/C.

Returns
The current operating mode setting.

◆ getPower()

bool IRGoodweatherAc::getPower ( void  )

Get the value of the current power setting.

Returns
true, the setting is on. false, the setting is off.

◆ getRaw()

uint64_t IRGoodweatherAc::getRaw ( void  )

Get a copy of the internal state as a valid code for this protocol.

Returns
A valid code for this protocol based on the current internal state.

◆ getSleep()

bool IRGoodweatherAc::getSleep ( void  )

Get the Sleep Toggle setting of the A/C.

Returns
true, the setting is on. false, the setting is off.

◆ getSwing()

uint8_t IRGoodweatherAc::getSwing ( void  )

Get the Vertical Swing speed of the A/C.

Returns
The native swing speed setting.

◆ getTemp()

uint8_t IRGoodweatherAc::getTemp ( void  )

Get the current temperature setting.

Returns
The current setting for temp. in degrees celsius.

◆ getTurbo()

bool IRGoodweatherAc::getTurbo ( void  )

Get the Turbo Toggle setting of the A/C.

Returns
true, the setting is on. false, the setting is off.

◆ off()

void IRGoodweatherAc::off ( void  )

Change the power setting to Off.

◆ on()

void IRGoodweatherAc::on ( void  )

Change the power setting to On.

◆ send()

void IRGoodweatherAc::send ( const uint16_t  repeat = kGoodweatherMinRepeat)

Send the current internal state as an IR message.

Parameters
[in]repeatNr. of times the message will be repeated.

◆ setCommand()

void IRGoodweatherAc::setCommand ( const uint8_t  cmd)

Set the remote Command type/button pressed.

Parameters
[in]cmdThe command/button that was issued/pressed.

◆ setFan()

void IRGoodweatherAc::setFan ( const uint8_t  speed)

Set the speed of the fan.

Parameters
[in]speedThe desired setting.

◆ setLight()

void IRGoodweatherAc::setLight ( const bool  toggle)

Set the Light (LED) Toggle setting of the A/C.

Parameters
[in]toggletrue, the setting is on. false, the setting is off.

◆ setMode()

void IRGoodweatherAc::setMode ( const uint8_t  mode)

Set the operating mode of the A/C.

Parameters
[in]modeThe desired operating mode.

◆ setPower()

void IRGoodweatherAc::setPower ( const bool  on)

Change the power setting.

Parameters
[in]ontrue, the setting is on. false, the setting is off.

◆ setRaw()

void IRGoodweatherAc::setRaw ( const uint64_t  state)

Set the internal state from a valid code for this protocol.

Parameters
[in]stateA valid code for this protocol.

◆ setSleep()

void IRGoodweatherAc::setSleep ( const bool  toggle)

Set the Sleep Toggle setting of the A/C.

Parameters
[in]toggletrue, the setting is on. false, the setting is off.

◆ setSwing()

void IRGoodweatherAc::setSwing ( const uint8_t  speed)

Set the Vertical Swing speed of the A/C.

Parameters
[in]speedThe speed to set the swing to.

◆ setTemp()

void IRGoodweatherAc::setTemp ( const uint8_t  temp)

Set the temperature.

Parameters
[in]tempThe temperature in degrees celsius.

◆ setTurbo()

void IRGoodweatherAc::setTurbo ( const bool  toggle)

Set the Turbo Toggle setting of the A/C.

Parameters
[in]toggletrue, the setting is on. false, the setting is off.

◆ stateReset()

void IRGoodweatherAc::stateReset ( void  )

Reset the internal state to a fixed known good state.

◆ toCommon()

stdAc::state_t IRGoodweatherAc::toCommon ( void  )

Convert the current internal state into its stdAc::state_t equivilant.

Returns
The stdAc equivilant of the native settings.

◆ toCommonFanSpeed()

stdAc::fanspeed_t IRGoodweatherAc::toCommonFanSpeed ( const uint8_t  speed)
static

Convert a native fan speed into its stdAc equivilant.

Parameters
[in]speedThe native setting to be converted.
Returns
The stdAc equivilant of the native setting.

◆ toCommonMode()

stdAc::opmode_t IRGoodweatherAc::toCommonMode ( const uint8_t  mode)
static

Convert a native mode into its stdAc equivilant.

Parameters
[in]modeThe native setting to be converted.
Returns
The stdAc equivilant of the native setting.

◆ toString()

String IRGoodweatherAc::toString ( )

Convert the current internal state into a human readable string.

Returns
A human readable string.

Member Data Documentation

◆ _irsend

IRsend IRGoodweatherAc::_irsend
private

Instance of the IR send class.

◆ remote

uint64_t IRGoodweatherAc::remote
private

The state of the IR remote in IR code form.


The documentation for this class was generated from the following files: