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

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

#include <ir_Voltas.h>

Collaboration diagram for IRVoltas:
Collaboration graph
[legend]

Public Member Functions

 IRVoltas (const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
 Class constructor. More...
 
void stateReset ()
 
void send (const uint16_t repeat=kNoRepeat)
 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 setModel (const voltas_ac_remote_model_t model)
 Set the current model for the remote. More...
 
voltas_ac_remote_model_t getModel (const bool raw=false) const
 Get the model information currently known. 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 on (void)
 Change the power setting to On. More...
 
void off (void)
 Change the power setting to Off. More...
 
void setWifi (const bool on)
 Change the Wifi setting. More...
 
bool getWifi (void) const
 Get the value of the current Wifi 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 (void)
 Get the operating mode setting of the A/C. More...
 
void setSwingH (const bool on)
 Set the Horizontal Swing setting of the A/C. More...
 
bool getSwingH (void) const
 Get the Horizontal Swing setting of the A/C. More...
 
void setSwingHChange (const bool on)
 Set the bits for changing the Horizontal Swing setting of the A/C. More...
 
bool getSwingHChange (void) const
 Are the Horizontal Swing change bits set in the message? More...
 
void setSwingV (const bool on)
 Set the Vertical Swing setting of the A/C. More...
 
bool getSwingV (void) const
 Get the Vertical Swing setting of the A/C. More...
 
void setEcono (const bool on)
 Change the Economy setting. More...
 
bool getEcono (void) const
 Get the value of the current Econo setting. More...
 
void setLight (const bool on)
 Change the Light setting. More...
 
bool getLight (void) const
 Get the value of the current Light setting. More...
 
void setTurbo (const bool on)
 Change the Turbo setting. More...
 
bool getTurbo (void) const
 Get the value of the current Turbo setting. More...
 
void setSleep (const bool on)
 Change the Sleep setting. More...
 
bool getSleep (void) const
 Get the value of the current Sleep setting. More...
 
uint16_t getOnTime (void) const
 Get the value of the On Timer time. More...
 
void setOnTime (const uint16_t nr_of_mins)
 Set the value of the On Timer time. More...
 
uint16_t getOffTime (void) const
 Get the value of the On Timer time. More...
 
void setOffTime (const uint16_t nr_of_mins)
 Set the value of the Off Timer time. 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...
 
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...
 
stdAc::state_t toCommon (const stdAc::state_t *prev=NULL)
 Convert the current internal state into its stdAc::state_t equivilant. More...
 
String toString (void)
 Convert the current internal state into a human readable string. More...
 

Static Public Member Functions

static bool validChecksum (const uint8_t state[], const uint16_t length=kVoltasStateLength)
 Verify the checksum is valid for a given state. More...
 
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 Member Functions

void checksum (void)
 Calculate and set the checksum values for the internal state. More...
 

Static Private Member Functions

static uint8_t calcChecksum (const uint8_t state[], const uint16_t length=kVoltasStateLength)
 Calculate the checksum is valid for a given state. More...
 

Private Attributes

IRsend _irsend
 Instance of the IR send class. More...
 
VoltasProtocol _
 The state of the IR remote. More...
 
voltas_ac_remote_model_t _model
 Model type. More...
 

Detailed Description

Class for handling detailed Voltas A/C messages.

Constructor & Destructor Documentation

◆ IRVoltas()

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

Set up hardware to be able to send a message.

◆ calcChecksum()

uint8_t IRVoltas::calcChecksum ( const uint8_t  state[],
const uint16_t  length = kVoltasStateLength 
)
staticprivate

Calculate the checksum is valid for a given state.

Parameters
[in]stateThe array to calculate the checksum of.
[in]lengthThe length of the state array.
Returns
The valid checksum value for the state.

◆ calibrate()

int8_t IRVoltas::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 IRVoltas::checksum ( void  )
private

Calculate and set the checksum values for the internal state.

◆ convertFan()

uint8_t IRVoltas::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 IRVoltas::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.

◆ getEcono()

bool IRVoltas::getEcono ( void  ) const

Get the value of the current Econo setting.

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

◆ getFan()

uint8_t IRVoltas::getFan ( void  )

Get the current fan speed setting.

Returns
The current fan speed/mode.

◆ getLight()

bool IRVoltas::getLight ( void  ) const

Get the value of the current Light setting.

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

◆ getMode()

uint8_t IRVoltas::getMode ( void  )

Get the operating mode setting of the A/C.

Returns
The current operating mode setting.

◆ getModel()

voltas_ac_remote_model_t IRVoltas::getModel ( const bool  raw = false) const

Get the model information currently known.

Parameters
[in]rawWork out the model info from the current raw state.
Returns
The known model number.

◆ getOffTime()

uint16_t IRVoltas::getOffTime ( void  ) const

Get the value of the On Timer time.

Returns
Number of minutes before the timer activates.

◆ getOnTime()

uint16_t IRVoltas::getOnTime ( void  ) const

Get the value of the On Timer time.

Returns
Number of minutes before the timer activates.

◆ getPower()

bool IRVoltas::getPower ( void  ) const

Get the value of the current power setting.

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

◆ getRaw()

uint8_t * IRVoltas::getRaw ( void  )

Get a PTR to the internal state/code for this protocol.

Returns
PTR to a code for this protocol based on the current internal state.

◆ getSleep()

bool IRVoltas::getSleep ( void  ) const

Get the value of the current Sleep setting.

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

◆ getSwingH()

bool IRVoltas::getSwingH ( void  ) const

Get the Horizontal Swing setting of the A/C.

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

◆ getSwingHChange()

bool IRVoltas::getSwingHChange ( void  ) const

Are the Horizontal Swing change bits set in the message?

Returns
true, the correct bits are set. false, the correct bits are not set.

◆ getSwingV()

bool IRVoltas::getSwingV ( 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 IRVoltas::getTemp ( void  )

Get the current temperature setting.

Returns
The current setting for temp. in degrees celsius.

◆ getTurbo()

bool IRVoltas::getTurbo ( void  ) const

Get the value of the current Turbo setting.

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

◆ getWifi()

bool IRVoltas::getWifi ( void  ) const

Get the value of the current Wifi setting.

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

◆ off()

void IRVoltas::off ( void  )

Change the power setting to Off.

◆ on()

void IRVoltas::on ( void  )

Change the power setting to On.

◆ send()

void IRVoltas::send ( const uint16_t  repeat = kNoRepeat)

Send the current internal state as an IR message.

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

◆ setEcono()

void IRVoltas::setEcono ( const bool  on)

Change the Economy setting.

Parameters
[in]ontrue, the setting is on. false, the setting is off.
Note
The Economy setting is only available in Cool mode.

◆ setFan()

void IRVoltas::setFan ( const uint8_t  fan)

Set the speed of the fan.

Parameters
[in]fanThe desired setting.

◆ setLight()

void IRVoltas::setLight ( const bool  on)

Change the Light setting.

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

◆ setMode()

void IRVoltas::setMode ( const uint8_t  mode)

Set the operating mode of the A/C.

Parameters
[in]modeThe desired operating mode.
Note
If we get an unexpected mode, default to AUTO.

◆ setModel()

void IRVoltas::setModel ( const voltas_ac_remote_model_t  model)

Set the current model for the remote.

Parameters
[in]modelThe model number.

◆ setOffTime()

void IRVoltas::setOffTime ( const uint16_t  nr_of_mins)

Set the value of the Off Timer time.

Parameters
[in]nr_of_minsNumber of minutes before the timer activates. 0 disables the timer. Max is 23 hrs & 59 mins (1439 mins)

◆ setOnTime()

void IRVoltas::setOnTime ( const uint16_t  nr_of_mins)

Set the value of the On Timer time.

Parameters
[in]nr_of_minsNumber of minutes before the timer activates. 0 disables the timer. Max is 23 hrs & 59 mins (1439 mins)

◆ setPower()

void IRVoltas::setPower ( const bool  on)

Change the power setting.

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

◆ setRaw()

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

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

Parameters
[in]new_codeA valid code for this protocol.

◆ setSleep()

void IRVoltas::setSleep ( const bool  on)

Change the Sleep setting.

Parameters
[in]ontrue, the setting is on. false, the setting is off.
Note
The Sleep setting is only available in Cool mode.

◆ setSwingH()

void IRVoltas::setSwingH ( const bool  on)

Set the Horizontal Swing setting of the A/C.

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

◆ setSwingHChange()

void IRVoltas::setSwingHChange ( const bool  on)

Set the bits for changing the Horizontal Swing setting of the A/C.

Parameters
[in]ontrue, the change bits are set. false, the "no change" bits are set.

◆ setSwingV()

void IRVoltas::setSwingV ( 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 IRVoltas::setTemp ( const uint8_t  temp)

Set the temperature.

Parameters
[in]tempThe temperature in degrees celsius.

◆ setTurbo()

void IRVoltas::setTurbo ( const bool  on)

Change the Turbo setting.

Parameters
[in]ontrue, the setting is on. false, the setting is off.
Note
The Turbo setting is only available in Cool mode.

◆ setWifi()

void IRVoltas::setWifi ( const bool  on)

Change the Wifi setting.

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

◆ stateReset()

void IRVoltas::stateReset ( )

◆ toCommon()

stdAc::state_t IRVoltas::toCommon ( const stdAc::state_t prev = NULL)

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

Parameters
[in]prevPtr to the previous state if available.
Returns
The stdAc equivilant of the native settings.

◆ toCommonFanSpeed()

stdAc::fanspeed_t IRVoltas::toCommonFanSpeed ( const uint8_t  spd)
static

Convert a native fan speed into its stdAc equivilant.

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

◆ toCommonMode()

stdAc::opmode_t IRVoltas::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 IRVoltas::toString ( void  )

Convert the current internal state into a human readable string.

Returns
A human readable string.

◆ validChecksum()

bool IRVoltas::validChecksum ( const uint8_t  state[],
const uint16_t  length = kVoltasStateLength 
)
static

Verify the checksum is valid for a given state.

Parameters
[in]stateThe array to verify the checksum of.
[in]lengthThe length of the state array.
Returns
true, if the state has a valid checksum. Otherwise, false.

Member Data Documentation

◆ _

VoltasProtocol IRVoltas::_
private

The state of the IR remote.

◆ _irsend

IRsend IRVoltas::_irsend
private

Instance of the IR send class.

◆ _model

voltas_ac_remote_model_t IRVoltas::_model
private

Model type.


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