Skip to content

Commit

Permalink
added support "I FEEL" button and sensor temperature for AC Royal Cli…
Browse files Browse the repository at this point in the history
…ma fresh (TCL based)
  • Loading branch information
almirus committed Aug 29, 2024
1 parent 850a45f commit b9735a2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
24 changes: 24 additions & 0 deletions src/ir_Tcl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ using irutils::addModeToString;
using irutils::addModelToString;
using irutils::addSwingVToString;
using irutils::addTempFloatToString;
using irutils::addTempToString;
using irutils::minsToString;

#if SEND_TCL112AC
Expand Down Expand Up @@ -372,6 +373,26 @@ void IRTcl112Ac::setOffTimer(const uint16_t mins) {
_.TimerIndicator = _.OnTimerEnabled || _.OffTimerEnabled;
}

void IRTcl112Ac::setIFeel(const bool on)
{
_.IFeel = on;
}

bool IRTcl112Ac::getIFeel(void) const
{
return _.IFeel;
}

void IRTcl112Ac::setSensorTemp(const uint8_t celsius)
{
_.CurrentTemp = celsius;
}

uint8_t IRTcl112Ac::getSensorTemp(void) const
{
return _.CurrentTemp;
}

/// Convert a stdAc::opmode_t enum into its native mode.
/// @param[in] mode The enum to be converted.
/// @return The native equivalent of the enum.
Expand Down Expand Up @@ -515,6 +536,9 @@ String IRTcl112Ac::toString(void) const {
result += addBoolToString(_.Health, kHealthStr);
result += addBoolToString(_.Turbo, kTurboStr);
result += addBoolToString(getLight(), kLightStr);
result += addBoolToString(_.IFeel, kIFeelStr);
if (_.IFeel)
result += addTempToString(getSensorTemp(), true, true, true);
}
result += addLabeledString(
_.OnTimerEnabled ? minsToString(getOnTimer()) : kOffStr,
Expand Down
9 changes: 7 additions & 2 deletions src/ir_Tcl.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ union Tcl112Protocol{
uint8_t Mode :4;
uint8_t Health :1;
uint8_t Turbo :1;
uint8_t :2;
uint8_t :1;
uint8_t IFeel :1;
// Byte 7
uint8_t Temp :4;
uint8_t :4;
Expand All @@ -69,7 +70,7 @@ union Tcl112Protocol{
uint8_t OnTimer :6;
uint8_t :1; // 0
// Byte 11
uint8_t :8; // 00000000
uint8_t CurrentTemp :8; // IFEEL function
// Byte 12
uint8_t :3;
uint8_t SwingH :1;
Expand Down Expand Up @@ -174,6 +175,10 @@ class IRTcl112Ac {
void setOnTimer(const uint16_t mins);
uint16_t getOffTimer(void) const;
void setOffTimer(const uint16_t mins);
void setIFeel(const bool on);
bool getIFeel(void) const;
void setSensorTemp(const uint8_t celsius);
uint8_t getSensorTemp(void) const;
static bool isTcl(const uint8_t state[]);
static uint8_t convertMode(const stdAc::opmode_t mode);
static uint8_t convertFan(const stdAc::fanspeed_t speed);
Expand Down

0 comments on commit b9735a2

Please sign in to comment.