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

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

#include <ir_Teco.h>

Collaboration diagram for IRTecoAc:
Collaboration graph
[legend]

Public Member Functions

 IRTecoAc (const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
 Class constructor. More...
 
void stateReset (void)
 Reset the internal state of the emulation. More...
 
void send (const uint16_t repeat=kTecoDefaultRepeat)
 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...
 
void setTemp (const uint8_t temp)
 Set the temperature. More...
 
uint8_t getTemp (void) 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 setSwing (const bool on)
 Set the (vertical) swing setting of the A/C. More...
 
bool getSwing (void) const
 Get the (vertical) swing 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 setLight (const bool on)
 Set the Light (LED/Display) setting of the A/C. More...
 
bool getLight (void) const
 Get the Light (LED/Display) setting of the A/C. More...
 
void setHumid (const bool on)
 Set the Humid setting of the A/C. More...
 
bool getHumid (void) const
 Get the Humid setting of the A/C. More...
 
void setSave (const bool on)
 Set the Save setting of the A/C. More...
 
bool getSave (void) const
 Get the Save setting of the A/C. More...
 
uint16_t getTimer (void) const
 Get the timer time for when the A/C unit will switch power state. More...
 
void setTimer (const uint16_t mins)
 Set the timer for when the A/C unit will switch power state. More...
 
uint64_t getRaw (void) const
 Get a copy of the internal state/code for this protocol. More...
 
void setRaw (const uint64_t new_code)
 Set the internal state from a valid code for this protocol. More...
 
stdAc::state_t toCommon (void) const
 Convert the current internal state into its stdAc::state_t equivalent. More...
 
String toString (void) const
 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 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

bool getTimerEnabled (void) const
 Is the timer function enabled? More...
 

Private Attributes

IRsend _irsend
 Instance of the IR send class. More...
 
TecoProtocol _
 

Detailed Description

Class for handling detailed Teco A/C messages.

Constructor & Destructor Documentation

◆ IRTecoAc()

IRTecoAc::IRTecoAc ( 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 IRTecoAc::begin ( void  )

Set up hardware to be able to send a message.

◆ calibrate()

int8_t IRTecoAc::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 IRTecoAc::convertFan ( const stdAc::fanspeed_t  speed)
static

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

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

◆ convertMode()

uint8_t IRTecoAc::convertMode ( const stdAc::opmode_t  mode)
static

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

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

◆ getFan()

uint8_t IRTecoAc::getFan ( void  ) const

Get the current fan speed setting.

Returns
The current fan speed/mode.

◆ getHumid()

bool IRTecoAc::getHumid ( void  ) const

Get the Humid setting of the A/C.

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

◆ getLight()

bool IRTecoAc::getLight ( void  ) const

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

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

◆ getMode()

uint8_t IRTecoAc::getMode ( void  ) const

Get the operating mode setting of the A/C.

Returns
The current operating mode setting.

◆ getPower()

bool IRTecoAc::getPower ( void  ) const

Get the value of the current power setting.

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

◆ getRaw()

uint64_t IRTecoAc::getRaw ( void  ) const

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

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

◆ getSave()

bool IRTecoAc::getSave ( void  ) const

Get the Save setting of the A/C.

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

◆ getSleep()

bool IRTecoAc::getSleep ( void  ) const

Get the Sleep setting of the A/C.

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

◆ getSwing()

bool IRTecoAc::getSwing ( void  ) const

Get the (vertical) swing setting of the A/C.

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

◆ getTemp()

uint8_t IRTecoAc::getTemp ( void  ) const

Get the current temperature setting.

Returns
The current setting for temp. in degrees celsius.

◆ getTimer()

uint16_t IRTecoAc::getTimer ( void  ) const

Get the timer time for when the A/C unit will switch power state.

Returns
The number of minutes left on the timer. 0 means off.

◆ getTimerEnabled()

bool IRTecoAc::getTimerEnabled ( void  ) const
inlineprivate

Is the timer function enabled?

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

◆ off()

void IRTecoAc::off ( void  )

Set the requested power state of the A/C to off.

◆ on()

void IRTecoAc::on ( void  )

Set the requested power state of the A/C to on.

◆ send()

void IRTecoAc::send ( const uint16_t  repeat = kTecoDefaultRepeat)

Send the current internal state as an IR message.

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

◆ setFan()

void IRTecoAc::setFan ( const uint8_t  speed)

Set the speed of the fan.

Parameters
[in]speedThe desired setting.

◆ setHumid()

void IRTecoAc::setHumid ( const bool  on)

Set the Humid setting of the A/C.

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

◆ setLight()

void IRTecoAc::setLight ( const bool  on)

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

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

◆ setMode()

void IRTecoAc::setMode ( const uint8_t  mode)

Set the operating mode of the A/C.

Parameters
[in]modeThe desired operating mode.

◆ setPower()

void IRTecoAc::setPower ( const bool  on)

Change the power setting.

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

◆ setRaw()

void IRTecoAc::setRaw ( const uint64_t  new_code)

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

Parameters
[in]new_codeA valid code for this protocol.

◆ setSave()

void IRTecoAc::setSave ( const bool  on)

Set the Save setting of the A/C.

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

◆ setSleep()

void IRTecoAc::setSleep ( const bool  on)

Set the Sleep setting of the A/C.

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

◆ setSwing()

void IRTecoAc::setSwing ( const bool  on)

Set the (vertical) swing setting of the A/C.

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

◆ setTemp()

void IRTecoAc::setTemp ( const uint8_t  temp)

Set the temperature.

Parameters
[in]tempThe temperature in degrees celsius.

◆ setTimer()

void IRTecoAc::setTimer ( const uint16_t  nr_mins)

Set the timer for when the A/C unit will switch power state.

Parameters
[in]nr_minsNumber of minutes before power state change. 0 will clear the timer. Max is 24 hrs.
Note
Time is stored internally in increments of 30 mins.

◆ stateReset()

void IRTecoAc::stateReset ( void  )

Reset the internal state of the emulation.

Note
Mode:auto, Power:Off, fan:auto, temp:16, swing:off, sleep:off

◆ toCommon()

stdAc::state_t IRTecoAc::toCommon ( void  ) const

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

Returns
The stdAc equivalent of the native settings.

◆ toCommonFanSpeed()

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

Convert a native fan speed into its stdAc equivalent.

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

◆ toCommonMode()

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

Convert a native mode into its stdAc equivalent.

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

◆ toString()

String IRTecoAc::toString ( void  ) const

Convert the current internal state into a human readable string.

Returns
A human readable string.

Member Data Documentation

◆ _

TecoProtocol IRTecoAc::_
private

◆ _irsend

IRsend IRTecoAc::_irsend
private

Instance of the IR send class.


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