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

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

#include <ir_Technibel.h>

Collaboration diagram for IRTechnibelAc:
Collaboration graph
[legend]

Public Member Functions

 IRTechnibelAc (const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
 Class constructor. More...
 
void stateReset ()
 Reset the internal state of the emulation. More...
 
void send (const uint16_t repeat=kTechnibelAcDefaultRepeat)
 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 setPower (const bool on)
 Change the power setting. More...
 
bool getPower ()
 Get the value of the current power setting. More...
 
void on ()
 Set the requested power state of the A/C to on. More...
 
void off ()
 Set the requested power state of the A/C to off. More...
 
void setTempUnit (const bool celsius)
 Set the temperature unit setting. More...
 
bool getTempUnit (void)
 Get the temperature unit setting. More...
 
void setTemp (const uint8_t temp, const bool fahrenheit=false)
 Set the temperature. More...
 
uint8_t getTemp ()
 Get the current temperature setting. More...
 
void setFan (const uint8_t speed)
 Set the speed of the fan. More...
 
uint8_t getFan ()
 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 bool on)
 Set the (vertical) swing setting of the A/C. More...
 
bool getSwing ()
 Get the (vertical) swing setting of the A/C. More...
 
bool convertSwing (const stdAc::swingv_t swing)
 Convert a stdAc::swingv_t enum into it's native swing. More...
 
stdAc::swingv_t toCommonSwing (const bool swing)
 Convert a native swing into its stdAc equivalent. More...
 
void setSleep (const bool on)
 Set the Sleep setting of the A/C. More...
 
bool getSleep ()
 Get the Sleep setting of the A/C. More...
 
void setTimerEnabled (const bool on)
 Set the enable timer setting. More...
 
bool getTimerEnabled (void)
 Is the timer function enabled? More...
 
void setTimer (const uint16_t nr_of_mins)
 Set the timer for when the A/C unit will switch off. More...
 
uint16_t getTimer (void)
 Get the timer time for when the A/C unit will switch power state. More...
 
uint64_t getRaw ()
 Get a copy of the internal state/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...
 
stdAc::state_t toCommon (void)
 Convert the current internal state into its stdAc::state_t equivalent. More...
 
String toString ()
 Convert the current internal state into a human readable string. More...
 

Static Public Member Functions

static uint8_t calcChecksum (const uint64_t state)
 Compute the checksum of the supplied state. More...
 
static bool validChecksum (const uint64_t state)
 Confirm the checksum of the supplied state is valid. 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

void checksum (void)
 Set the checksum of the internal state. More...
 

Private Attributes

IRsend _irsend
 
IRsendTest _irsend
 
uint64_t remote_state
 
uint8_t _saved_temp
 
uint8_t _saved_temp_units
 

Detailed Description

Class for handling detailed Technibel A/C messages.

Constructor & Destructor Documentation

◆ IRTechnibelAc()

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

Set up hardware to be able to send a message.

◆ calcChecksum()

uint8_t IRTechnibelAc::calcChecksum ( const uint64_t  state)
static

Compute the checksum of the supplied state.

Parameters
[in]stateA valid code for this protocol.
Returns
The calculated checksum of the supplied state.

◆ calibrate()

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

Set the checksum of the internal state.

◆ convertFan()

uint8_t IRTechnibelAc::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 equivalent of the enum.

◆ convertMode()

uint8_t IRTechnibelAc::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 equivalent of the enum.

◆ convertSwing()

bool IRTechnibelAc::convertSwing ( const stdAc::swingv_t  swing)

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

Parameters
[in]swingThe enum to be converted.
Returns
true, the swing is on. false, the swing is off.

◆ getFan()

uint8_t IRTechnibelAc::getFan ( )

Get the current fan speed setting.

Returns
The current fan speed/mode.

◆ getMode()

uint8_t IRTechnibelAc::getMode ( )

Get the operating mode setting of the A/C.

Returns
The current operating mode setting.

◆ getPower()

bool IRTechnibelAc::getPower ( )

Get the value of the current power setting.

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

◆ getRaw()

uint64_t IRTechnibelAc::getRaw ( )

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

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

◆ getSleep()

bool IRTechnibelAc::getSleep ( )

Get the Sleep setting of the A/C.

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

◆ getSwing()

bool IRTechnibelAc::getSwing ( )

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

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

◆ getTemp()

uint8_t IRTechnibelAc::getTemp ( )

Get the current temperature setting.

Returns
The current setting for temp. in degrees.

◆ getTempUnit()

bool IRTechnibelAc::getTempUnit ( void  )

Get the temperature unit setting.

Returns
true, the unit is °F. false, the unit is °C.

◆ getTimer()

uint16_t IRTechnibelAc::getTimer ( void  )

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 IRTechnibelAc::getTimerEnabled ( void  )

Is the timer function enabled?

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

◆ off()

void IRTechnibelAc::off ( )

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

◆ on()

void IRTechnibelAc::on ( )

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

◆ send()

void IRTechnibelAc::send ( const uint16_t  repeat = kTechnibelAcDefaultRepeat)

Send the current internal state as an IR message.

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

◆ setFan()

void IRTechnibelAc::setFan ( const uint8_t  speed)

Set the speed of the fan.

Parameters
[in]speedThe desired setting.

◆ setMode()

void IRTechnibelAc::setMode ( const uint8_t  mode)

Set the operating mode of the A/C.

Parameters
[in]modeThe desired operating mode.

◆ setPower()

void IRTechnibelAc::setPower ( const bool  on)

Change the power setting.

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

◆ setRaw()

void IRTechnibelAc::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 IRTechnibelAc::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 IRTechnibelAc::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 IRTechnibelAc::setTemp ( const uint8_t  degrees,
const bool  fahrenheit = false 
)

Set the temperature.

Parameters
[in]degreesThe temperature in degrees.
[in]fahrenheitThe temperature unit: true=°F, false(default)=°C.

◆ setTempUnit()

void IRTechnibelAc::setTempUnit ( const bool  fahrenheit)

Set the temperature unit setting.

Parameters
[in]fahrenheittrue, the unit is °F. false, the unit is °C.

◆ setTimer()

void IRTechnibelAc::setTimer ( const uint16_t  nr_of_mins)

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

Parameters
[in]nr_of_minsNumber of minutes before power off. 0 will clear the timer. Max is 24 hrs (1440 mins).
Note
Time is stored internally in hours.

◆ setTimerEnabled()

void IRTechnibelAc::setTimerEnabled ( const bool  on)

Set the enable timer setting.

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

◆ stateReset()

void IRTechnibelAc::stateReset ( )

Reset the internal state of the emulation.

Note
Mode:Cool, Power:Off, fan:Low, temp:20, swing:Off, sleep:Off

◆ toCommon()

stdAc::state_t IRTechnibelAc::toCommon ( void  )

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

Returns
The stdAc equivalent of the native settings.

◆ toCommonFanSpeed()

stdAc::fanspeed_t IRTechnibelAc::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 IRTechnibelAc::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.

◆ toCommonSwing()

stdAc::swingv_t IRTechnibelAc::toCommonSwing ( const bool  swing)

Convert a native swing into its stdAc equivalent.

Parameters
[in]swingtrue, the swing is on. false, the swing is off.
Returns
The stdAc equivalent of the native setting.

◆ toString()

String IRTechnibelAc::toString ( )

Convert the current internal state into a human readable string.

Returns
A human readable string.

◆ validChecksum()

bool IRTechnibelAc::validChecksum ( const uint64_t  state)
static

Confirm the checksum of the supplied state is valid.

Parameters
[in]stateA valid code for this protocol.
Returns
true if the checksum is correct, otherwise false.

Member Data Documentation

◆ _irsend [1/2]

IRsend IRTechnibelAc::_irsend
private

◆ _irsend [2/2]

IRsendTest IRTechnibelAc::_irsend
private

◆ _saved_temp

uint8_t IRTechnibelAc::_saved_temp
private

◆ _saved_temp_units

uint8_t IRTechnibelAc::_saved_temp_units
private

◆ remote_state

uint64_t IRTechnibelAc::remote_state
private

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