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

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

#include <ir_York.h>

Collaboration diagram for IRYorkAc:
Collaboration graph
[legend]

Public Member Functions

 IRYorkAc (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 setPowerToggle (const bool on)
 
bool getPowerToggle () const
 
void setTemp (const uint8_t temp)
 Set the temperature. More...
 
uint8_t getTemp () const
 Get the current temperature setting. More...
 
void setFan (const uint8_t speed)
 Set the speed of the fan. More...
 
uint8_t getFan () const
 Get the current fan speed setting. More...
 
void setMode (const uint8_t mode)
 Set the desired operation mode. More...
 
uint8_t getMode () const
 Get the current operation mode setting. More...
 
uint16_t getOnTimer (void) const
 Get the On Timer setting of the A/C. More...
 
uint16_t getOffTimer (void) const
 Get the Off Timer setting of the A/C. More...
 
void setOnTimer (const uint16_t mins)
 Set the On Timer value of the A/C. More...
 
void setOffTimer (const uint16_t mins)
 Set the Off Timer value of the A/C. More...
 
uint8_t * getRaw ()
 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[], const uint16_t length=kYorkStateLength)
 Set the internal state from a valid code for this protocol. More...
 
void calcChecksum ()
 CRC16-16 (a.k.a. CRC-16-IBM) More...
 
stdAc::state_t toCommon (const stdAc::state_t *prev=NULL) const
 Convert the current internal state into its stdAc::state_t equivalent. More...
 
String toString () 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 Attributes

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

Detailed Description

Class for handling detailed York A/C messages.

Constructor & Destructor Documentation

◆ IRYorkAc()

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

Set up hardware to be able to send a message.

◆ calcChecksum()

void IRYorkAc::calcChecksum ( )

CRC16-16 (a.k.a. CRC-16-IBM)

◆ calibrate()

int8_t IRYorkAc::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 IRYorkAc::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 IRYorkAc::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 IRYorkAc::getFan ( ) const

Get the current fan speed setting.

Returns
The current fan speed.

◆ getMode()

uint8_t IRYorkAc::getMode ( ) const

Get the current operation mode setting.

Returns
The current operation mode.

◆ getOffTimer()

uint16_t IRYorkAc::getOffTimer ( void  ) const

Get the Off Timer setting of the A/C.

Returns
The Nr. of minutes the Off Timer is set for.
Note
Sleep & Off Timer share the same timer.

◆ getOnTimer()

uint16_t IRYorkAc::getOnTimer ( void  ) const

Get the On Timer setting of the A/C.

Returns
The Nr. of minutes the On Timer is set for.

◆ getPowerToggle()

bool IRYorkAc::getPowerToggle ( ) const

◆ getRaw()

uint8_t * IRYorkAc::getRaw ( )

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

Returns
A copy of the internal state.

◆ getTemp()

uint8_t IRYorkAc::getTemp ( ) const

Get the current temperature setting.

Returns
Get current setting for temp. in degrees celsius.

◆ send()

void IRYorkAc::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.

◆ setFan()

void IRYorkAc::setFan ( const uint8_t  speed)

Set the speed of the fan.

Parameters
[in]speedThe desired setting.
Note
The fan speed is locked to Low when in Dry mode, to auto when in auto mode. "Fan" mode has no support for "auto" speed.

◆ setMode()

void IRYorkAc::setMode ( const uint8_t  mode)

Set the desired operation mode.

Parameters
[in]modeThe desired operation mode.

◆ setOffTimer()

void IRYorkAc::setOffTimer ( const uint16_t  nr_of_mins)

Set the Off Timer value of the A/C.

Parameters
[in]nr_of_minsThe number of minutes the timer should be.
Note
The timer time only has a resolution of 10 mins.
Setting the Off Timer active will cancel the Sleep timer/setting.

◆ setOnTimer()

void IRYorkAc::setOnTimer ( const uint16_t  nr_of_mins)

Set the On Timer value of the A/C.

Parameters
[in]nr_of_minsThe number of minutes the timer should be.
Note
The timer time only has a resolution of 10 mins.
Setting the On Timer active will cancel the Sleep timer/setting.

◆ setPowerToggle()

void IRYorkAc::setPowerToggle ( const bool  on)

◆ setRaw()

void IRYorkAc::setRaw ( const uint8_t  new_code[],
const uint16_t  length = kYorkStateLength 
)

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

Parameters
[in]new_codeA valid code for this protocol.
[in]lengthLength of the code in bytes.

◆ setTemp()

void IRYorkAc::setTemp ( const uint8_t  degrees)

Set the temperature.

Parameters
[in]degreesThe temperature in degrees celsius.

◆ stateReset()

void IRYorkAc::stateReset ( )

◆ toCommon()

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

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

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

◆ toCommonFanSpeed()

stdAc::fanspeed_t IRYorkAc::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 IRYorkAc::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 IRYorkAc::toString ( ) const

Convert the current internal state into a human readable string.

Returns
A human readable string.

Member Data Documentation

◆ _

YorkProtocol IRYorkAc::_
private

◆ _irsend

IRsend IRYorkAc::_irsend
private

Instance of the IR send class.


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