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:
[legend]

## Public Member Functions
| IRTechnibelAc (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=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 (void)
| Set up hardware to be able to send a message. 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)
| 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 | setTempUnit (const bool celsius)
| Set the temperature unit setting. More...
bool | getTempUnit (void) const
| Get the temperature unit setting. More...
void | setTemp (const uint8_t temp, const bool fahrenheit=false)
| Set the temperature. 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 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 | setTimerEnabled (const bool on)
| Set the enable timer setting. More...
bool | getTimerEnabled (void) const
| 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) const
| Get the timer time for when the A/C unit will switch power state. More...
uint64_t | getRaw (void)
| 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...
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 | 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 bool | convertSwing (const stdAc::swingv_t swing)
| Convert a stdAc::swingv_t enum into it's native swing. More...
static stdAc::swingv_t | toCommonSwing (const bool swing)
| Convert a native swing into its stdAc equivalent. More...
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
void | checksum (void)
| Set the checksum of the internal state. More...

## Private Attributes
IRsend | _irsend
IRsendTest | _irsend
TechnibelProtocol | _
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] | pin | GPIO to be used when sending.
  [in] | inverted | Is the output signal to be inverted?
  [in] | use_modulation | Is frequency modulation to be used?

## Member Function Documentation

## ◆ begin()

void IRTechnibelAc::begin | ( | void |  | ) |

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] | state | A 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 | ) |
| static

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

Parameters

  [in] | speed | The enum to be converted.

Returns
  The native equivalent of the enum.

## ◆ convertMode()

uint8_t IRTechnibelAc::convertMode | ( | const stdAc::opmode_t | mode | ) |
| static

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

Parameters

  [in] | mode | The enum to be converted.

Returns
  The native equivalent of the enum.

## ◆ convertSwing()

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

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

Parameters

  [in] | swing | The enum to be converted.

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

## ◆ getFan()

uint8_t IRTechnibelAc::getFan | ( | void |  | ) | const

Get the current fan speed setting.

Returns
  The current fan speed/mode.

## ◆ getMode()

uint8_t IRTechnibelAc::getMode | ( | void |  | ) | const

Get the operating mode setting of the A/C.

Returns
  The current operating mode setting.

## ◆ getPower()

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

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 | ( | void |  | ) | const

Get the Sleep setting of the A/C.

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

## ◆ getSwing()

bool IRTechnibelAc::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 IRTechnibelAc::getTemp | ( | void |  | ) | const

Get the current temperature setting.

Returns
  The current setting for temp. in degrees.

## ◆ getTempUnit()

bool IRTechnibelAc::getTempUnit | ( | void |  | ) | const

Get the temperature unit setting.

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

## ◆ getTimer()

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

Is the timer function enabled?

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

## ◆ off()

void IRTechnibelAc::off | ( | void |  | ) |

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

## ◆ on()

void IRTechnibelAc::on | ( | void |  | ) |

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] | repeat | Nr. of times the message will be repeated.

## ◆ setFan()

void IRTechnibelAc::setFan | ( | const uint8_t | speed | ) |

Set the speed of the fan.

Parameters

  [in] | speed | The desired setting.

## ◆ setMode()

void IRTechnibelAc::setMode | ( | const uint8_t | mode | ) |

Set the operating mode of the A/C.

Parameters

  [in] | mode | The desired operating mode.

## ◆ setPower()

void IRTechnibelAc::setPower | ( | const bool | on | ) |

Change the power setting.

Parameters

  [in] | on | true, 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] | state | A valid code for this protocol.

## ◆ setSleep()

void IRTechnibelAc::setSleep | ( | const bool | on | ) |

Set the Sleep setting of the A/C.

Parameters

  [in] | on | true, 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] | on | true, 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] | degrees | The temperature in degrees.
  [in] | fahrenheit | The temperature unit: true=°F, false(default)=°C.

## ◆ setTempUnit()

void IRTechnibelAc::setTempUnit | ( | const bool | fahrenheit | ) |

Set the temperature unit setting.

Parameters

  [in] | fahrenheit | true, 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_mins | Number 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] | on | true, the setting is on. false, the setting is off.

## ◆ stateReset()

void IRTechnibelAc::stateReset | ( | void |  | ) |

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 |  | ) | const

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] | speed | The 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] | mode | The native setting to be converted.

Returns
  The stdAc equivalent of the native setting.

## ◆ toCommonSwing()

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

Convert a native swing into its stdAc equivalent.

Parameters

  [in] | swing | true, the swing is on. false, the swing is off.

Returns
  The stdAc equivalent of the native setting.

## ◆ toString()

String IRTechnibelAc::toString | ( | void |  | ) | const

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] | state | A valid code for this protocol.

Returns
  `true` if the checksum is correct, otherwise `false`.

## Member Data Documentation

## ◆ _

TechnibelProtocol IRTechnibelAc::_
| private

## ◆ _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

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

- src/ir_Technibel.h
- src/ir_Technibel.cpp