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

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

#include <ir_Kelvinator.h>

Collaboration diagram for IRKelvinatorAC:
Collaboration graph
[legend]

Public Member Functions

 IRKelvinatorAC (const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
 Class constructor. More...
 
void stateReset (void)
 Reset the internals of the object to a known good state. More...
 
void send (const uint16_t repeat=kKelvinatorDefaultRepeat)
 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 internal state to have the power on. More...
 
void off (void)
 Set the internal state to have the power off. More...
 
void setPower (const bool on)
 Set the internal state to have the desired power. More...
 
bool getPower (void) const
 Get the power setting from the internal state. More...
 
void setTemp (const uint8_t degrees)
 Set the temperature setting. More...
 
uint8_t getTemp (void) const
 Get the current temperature setting. 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 mode)
 Set the desired operation mode. More...
 
uint8_t getMode (void) const
 Get the current operation mode setting. 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...
 
void setSwingHorizontal (const bool on)
 Control the current horizontal swing setting. More...
 
bool getSwingHorizontal (void) const
 Is the horizontal swing setting on? More...
 
void setQuiet (const bool on)
 Control the current Quiet setting. More...
 
bool getQuiet (void) const
 Is the Quiet setting on? More...
 
void setIonFilter (const bool on)
 Control the current Ion Filter setting. More...
 
bool getIonFilter (void) const
 Is the Ion Filter setting on? More...
 
void setLight (const bool on)
 Control the current Light setting. i.e. The LED display on the A/C unit that shows the basic settings. More...
 
bool getLight (void) const
 Is the Light (Display) setting on? More...
 
void setXFan (const bool on)
 Control the current XFan setting. This setting will cause the unit blow air after power off to dry out the A/C device. More...
 
bool getXFan (void) const
 Is the XFan setting on? More...
 
void setTurbo (const bool on)
 Control the current Turbo setting. More...
 
bool getTurbo (void) const
 Is the Turbo setting on? More...
 
uint8_t * getRaw (void)
 Get the raw state of the object, suitable to be sent with the appropriate IRsend object method. More...
 
void setRaw (const uint8_t new_code[])
 Set the raw state of the object. More...
 
stdAc::state_t toCommon (void) const
 Convert the internal A/C object state to it's stdAc::state_t equivalent. More...
 
String toString (void) const
 Convert the internal settings into a human readable string. More...
 

Static Public Member Functions

static uint8_t convertSwingV (const stdAc::swingv_t swingv)
 Convert a stdAc::swingv_t enum into it's native setting. More...
 
static stdAc::swingv_t toCommonSwingV (const uint8_t pos)
 
static uint8_t calcBlockChecksum (const uint8_t *block, const uint16_t length=kKelvinatorStateLength/2)
 Calculate the checksum for a given block of state. More...
 
static bool validChecksum (const uint8_t state[], const uint16_t length=kKelvinatorStateLength)
 Verify the checksum is valid for a given state. More...
 
static uint8_t convertMode (const stdAc::opmode_t mode)
 Convert a standard A/C mode (stdAc::opmode_t) into it a native mode. More...
 
static stdAc::opmode_t toCommonMode (const uint8_t mode)
 Convert a native mode to it's stdAc::opmode_t equivalent. More...
 
static stdAc::fanspeed_t toCommonFanSpeed (const uint8_t speed)
 Convert a native fan speed to it's stdAc::fanspeed_t equivalent. More...
 

Private Member Functions

void checksum (void)
 Calculate the checksum for the internal state. More...
 
void fixup (void)
 Fix up any odd conditions for the current state. More...
 

Private Attributes

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

Detailed Description

Class for handling detailed Kelvinator A/C messages.

Constructor & Destructor Documentation

◆ IRKelvinatorAC()

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

Set up hardware to be able to send a message.

◆ calcBlockChecksum()

uint8_t IRKelvinatorAC::calcBlockChecksum ( const uint8_t *  block,
const uint16_t  length = kKelvinatorStateLength / 2 
)
static

Calculate the checksum for a given block of state.

Parameters
[in]blockA pointer to a block to calc the checksum of.
[in]lengthLength of the block array to checksum.
Returns
The calculated checksum value.
Note
Many Bothans died to bring us this information.

◆ calibrate()

int8_t IRKelvinatorAC::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.

◆ checksum()

void IRKelvinatorAC::checksum ( void  )
private

Calculate the checksum for the internal state.

◆ convertMode()

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

Convert a standard A/C mode (stdAc::opmode_t) into it a native mode.

Parameters
[in]modeA stdAc::opmode_t operation mode.
Returns
The native mode equivalent.

◆ convertSwingV()

uint8_t IRKelvinatorAC::convertSwingV ( const stdAc::swingv_t  swingv)
static

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

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

◆ fixup()

void IRKelvinatorAC::fixup ( void  )
private

Fix up any odd conditions for the current state.

◆ getFan()

uint8_t IRKelvinatorAC::getFan ( void  ) const

Get the current fan speed setting.

Returns
The current fan speed.

◆ getIonFilter()

bool IRKelvinatorAC::getIonFilter ( void  ) const

Is the Ion Filter setting on?

Returns
The current value.

◆ getLight()

bool IRKelvinatorAC::getLight ( void  ) const

Is the Light (Display) setting on?

Returns
The current value.

◆ getMode()

uint8_t IRKelvinatorAC::getMode ( void  ) const

Get the current operation mode setting.

Returns
The current operation mode.

◆ getPower()

bool IRKelvinatorAC::getPower ( void  ) const

Get the power setting from the internal state.

Returns
A boolean indicating if the power setting.

◆ getQuiet()

bool IRKelvinatorAC::getQuiet ( void  ) const

Is the Quiet setting on?

Returns
The current value.

◆ getRaw()

uint8_t * IRKelvinatorAC::getRaw ( void  )

Get the raw state of the object, suitable to be sent with the appropriate IRsend object method.

Returns
A PTR to the internal state.

◆ getSwingHorizontal()

bool IRKelvinatorAC::getSwingHorizontal ( void  ) const

Is the horizontal swing setting on?

Returns
The current value.

◆ getSwingVerticalAuto()

bool IRKelvinatorAC::getSwingVerticalAuto ( void  ) const

Get the Vertical Swing Automatic mode setting of the A/C.

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

◆ getSwingVerticalPosition()

uint8_t IRKelvinatorAC::getSwingVerticalPosition ( void  ) const

Get the Vertical Swing position setting of the A/C.

Returns
The native position/mode.

◆ getTemp()

uint8_t IRKelvinatorAC::getTemp ( void  ) const

Get the current temperature setting.

Returns
Get current setting for temp. in degrees celsius.

◆ getTurbo()

bool IRKelvinatorAC::getTurbo ( void  ) const

Is the Turbo setting on?

Returns
The current value.

◆ getXFan()

bool IRKelvinatorAC::getXFan ( void  ) const

Is the XFan setting on?

Returns
The current value.

◆ off()

void IRKelvinatorAC::off ( void  )

Set the internal state to have the power off.

◆ on()

void IRKelvinatorAC::on ( void  )

Set the internal state to have the power on.

◆ send()

void IRKelvinatorAC::send ( const uint16_t  repeat = kKelvinatorDefaultRepeat)

Send the current internal state as an IR message.

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

◆ setFan()

void IRKelvinatorAC::setFan ( const uint8_t  speed)

Set the speed of the fan.

Parameters
[in]speed0 is auto, 1-5 is the speed

◆ setIonFilter()

void IRKelvinatorAC::setIonFilter ( const bool  on)

Control the current Ion Filter setting.

Parameters
[in]onThe desired setting.

◆ setLight()

void IRKelvinatorAC::setLight ( const bool  on)

Control the current Light setting. i.e. The LED display on the A/C unit that shows the basic settings.

Parameters
[in]onThe desired setting.

◆ setMode()

void IRKelvinatorAC::setMode ( const uint8_t  mode)

Set the desired operation mode.

Parameters
[in]modeThe desired operation mode.

◆ setPower()

void IRKelvinatorAC::setPower ( const bool  on)

Set the internal state to have the desired power.

Parameters
[in]onThe desired power state.

◆ setQuiet()

void IRKelvinatorAC::setQuiet ( const bool  on)

Control the current Quiet setting.

Parameters
[in]onThe desired setting.

◆ setRaw()

void IRKelvinatorAC::setRaw ( const uint8_t  new_code[])

Set the raw state of the object.

Parameters
[in]new_codeThe raw state from the native IR message.

◆ setSwingHorizontal()

void IRKelvinatorAC::setSwingHorizontal ( const bool  on)

Control the current horizontal swing setting.

Parameters
[in]onThe desired setting.

◆ setSwingVertical()

void IRKelvinatorAC::setSwingVertical ( const bool  automatic,
const uint8_t  position 
)

Set the Vertical Swing mode of the A/C.

Parameters
[in]automaticDo we use the automatic setting?
[in]positionThe position/mode to set the vanes to.

◆ setTemp()

void IRKelvinatorAC::setTemp ( const uint8_t  degrees)

Set the temperature setting.

Parameters
[in]degreesThe temperature in degrees celsius.

◆ setTurbo()

void IRKelvinatorAC::setTurbo ( const bool  on)

Control the current Turbo setting.

Note
Turbo mode is turned off if the fan speed is changed.
Parameters
[in]onThe desired setting.

◆ setXFan()

void IRKelvinatorAC::setXFan ( const bool  on)

Control the current XFan setting. This setting will cause the unit blow air after power off to dry out the A/C device.

Note
XFan mode is only valid in Cool or Dry mode.
Parameters
[in]onThe desired setting.

◆ stateReset()

void IRKelvinatorAC::stateReset ( void  )

Reset the internals of the object to a known good state.

◆ toCommon()

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

Convert the internal A/C object state to it's stdAc::state_t equivalent.

Returns
A stdAc::state_t containing the current settings.

◆ toCommonFanSpeed()

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

Convert a native fan speed to it's stdAc::fanspeed_t equivalent.

Parameters
[in]speedA native fan speed value.
Returns
The stdAc::fanspeed_t equivalent.

◆ toCommonMode()

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

Convert a native mode to it's stdAc::opmode_t equivalent.

Parameters
[in]modeA native operating mode value.
Returns
The stdAc::opmode_t equivalent.

◆ toCommonSwingV()

static stdAc::swingv_t IRKelvinatorAC::toCommonSwingV ( const uint8_t  pos)
static

◆ toString()

String IRKelvinatorAC::toString ( void  ) const

Convert the internal settings into a human readable string.

Returns
A String.

◆ validChecksum()

bool IRKelvinatorAC::validChecksum ( const uint8_t  state[],
const uint16_t  length = kKelvinatorStateLength 
)
static

Verify the checksum is valid for a given state.

Parameters
[in]stateThe array to verify the checksum of.
[in]lengthThe size of the state.
Returns
A boolean indicating if it is valid.

Member Data Documentation

◆ _

KelvinatorProtocol IRKelvinatorAC::_
private

◆ _irsend

IRsend IRKelvinatorAC::_irsend
private

Instance of the IR send class.


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