Skip to content

Commit

Permalink
[MIRAGE] Experimental detailed support for KKG29A-C1 remote.
Browse files Browse the repository at this point in the history
* Add support for KKG29A-C1 model.
  - IFeel
  - Sensor Temp
  - Quiet
  - Filter (UVC)
  - Clean
  - On & Off Timers
  - SwingH
* Add model detection.
* Add support to `IRac` class.
* Update existing unit tests.
  - Lots more unit tests needed for the new stuff.
* Update supported models.

For #1573
  • Loading branch information
crankyoldgit committed Nov 1, 2021
1 parent 49bfe4c commit 23acd95
Show file tree
Hide file tree
Showing 11 changed files with 664 additions and 125 deletions.
35 changes: 22 additions & 13 deletions src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1481,36 +1481,41 @@ void IRac::midea(IRMideaAC *ac,
#if SEND_MIRAGE
/// Send a Mirage 120-bit A/C message with the supplied settings.
/// @param[in, out] ac A Ptr to an IRMitsubishiAC object to use.
/// @param[in] model The A/C model to use.
/// @param[in] on The power setting.
/// @param[in] mode The operation mode setting.
/// @param[in] degrees The temperature setting in degrees.
/// @param[in] fan The speed setting for the fan.
/// @param[in] swingv The vertical swing setting.
/// @param[in] swingh The horizontal swing setting.
/// @param[in] turbo Run the device in turbo mode.
/// @param[in] quiet Run the device in quiet/silent mode.
/// @param[in] light Turn on the Light/Display.
/// @param[in] filter Turn on the (UVC/ion/pollen/etc) filter mode.
/// @param[in] clean Turn on the self-cleaning mode. e.g. XFan, dry filters etc
/// @param[in] sleep The time in Nr. of mins to sleep for. < 0 is ignore.
/// @note Sleep is either on or off. The time is useless.
/// @param[in] clock The time in Nr. of mins since midnight. < 0 is ignore.
void IRac::mirage(IRMirageAc *ac,
const bool on,
const stdAc::opmode_t mode,
const float degrees,
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
const bool turbo, const bool light,
void IRac::mirage(IRMirageAc *ac, const mirage_ac_remote_model_t model,
const bool on, const stdAc::opmode_t mode,
const float degrees, const stdAc::fanspeed_t fan,
const stdAc::swingv_t swingv, const stdAc::swingh_t swingh,
const bool turbo, const bool quiet, const bool light,
const bool filter, const bool clean,
const int16_t sleep, const int16_t clock) {
ac->begin();

ac->setModel(model);
ac->setPower(on);
ac->setMode(ac->convertMode(mode));
ac->setTemp(degrees);
ac->setFan(ac->convertFan(fan));
ac->setSwingV(ac->convertSwingV(swingv));
// No SwingH setting available
ac->setSwingH(swingh != stdAc::swingh_t::kOff);
ac->setTurbo(turbo);
// No Quiet setting available.
ac->setQuiet(quiet);
ac->setLight(light);
// No Filter setting available.
// No Clean setting available.
ac->setFilter(filter);
ac->setCleanToggle(clean);
// No Beep setting available.
ac->setSleep(sleep >= 0);
if (clock >= 0) ac->setClock(clock * 60); // Clock is in seconds.
Expand Down Expand Up @@ -2526,6 +2531,9 @@ stdAc::state_t IRac::handleToggles(const stdAc::state_t desired,
case decode_type_t::WHIRLPOOL_AC:
result.power = desired.power ^ prev->power;
break;
case decode_type_t::MIRAGE:
result.clean = desired.clean ^ prev->clean;
break;
case decode_type_t::PANASONIC_AC:
// CKP models use a power mode toggle.
if (desired.model == panasonic_ac_remote_model_t::kPanasonicCkp)
Expand Down Expand Up @@ -2897,8 +2905,9 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
case MIRAGE:
{
IRMirageAc ac(_pin, _inverted, _modulation);
mirage(&ac, send.power, send.mode, degC,
send.fanspeed, send.swingv, send.turbo, send.light,
mirage(&ac, (mirage_ac_remote_model_t)send.model, send.power, send.mode,
degC, send.fanspeed, send.swingv, send.swingh,
send.turbo, send.quiet, send.light, send.filter, send.clean,
send.sleep, send.clock);
break;
}
Expand Down
6 changes: 4 additions & 2 deletions src/IRac.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,12 @@ void electra(IRElectraAc *ac,
const bool light, const int16_t sleep = -1);
#endif // SEND_MIDEA
#if SEND_MIRAGE
void mirage(IRMirageAc *ac,
void mirage(IRMirageAc *ac, const mirage_ac_remote_model_t model,
const bool on, const stdAc::opmode_t mode,
const float degrees, const stdAc::fanspeed_t fan,
const stdAc::swingv_t swingv, const bool turbo, const bool light,
const stdAc::swingv_t swingv, const stdAc::swingh_t swingh,
const bool turbo, const bool quiet, const bool light,
const bool filter, const bool clean,
const int16_t sleep = -1, const int16_t clock = -1);
#endif // SEND_MIRAGE
#if SEND_MITSUBISHI_AC
Expand Down
6 changes: 6 additions & 0 deletions src/IRsend.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ enum hitachi_ac1_remote_model_t {
R_LT0541_HTA_B, // (2) R-LT0541-HTA Remote in "B" setting.
};

/// MIRAGE A/C model numbers
enum mirage_ac_remote_model_t {
KKG9AC1 = 1, // (1) KKG9A-C1 Remote. (Default)
KKG29AC1, // (2) KKG29A-C1 Remote.
};

/// Panasonic A/C model numbers
enum panasonic_ac_remote_model_t {
kPanasonicUnknown = 0,
Expand Down
2 changes: 2 additions & 0 deletions src/IRtext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ IRTEXT_CONST_STRING(kGe6711ar2853mStr, D_STR_GE6711AR2853M); ///<
IRTEXT_CONST_STRING(kAkb75215403Str, D_STR_AKB75215403); ///< "AKB75215403"
IRTEXT_CONST_STRING(kAkb74955603Str, D_STR_AKB74955603); ///< "AKB74955603"
IRTEXT_CONST_STRING(kAkb73757604Str, D_STR_AKB73757604); ///< "AKB73757604"
IRTEXT_CONST_STRING(kKkg9ac1Str, D_STR_KKG9AC1); ///< "KKG9AC1"
IRTEXT_CONST_STRING(kKkg29ac1Str, D_STR_KKG29AC1); ///< "KKG29AC1"
IRTEXT_CONST_STRING(kLkeStr, D_STR_LKE); ///< "LKE"
IRTEXT_CONST_STRING(kNkeStr, D_STR_NKE); ///< "NKE"
IRTEXT_CONST_STRING(kDkeStr, D_STR_DKE); ///< "DKE"
Expand Down
2 changes: 2 additions & 0 deletions src/IRtext.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ extern IRTEXT_CONST_PTR(kIFeelStr);
extern IRTEXT_CONST_PTR(kInsideStr);
extern IRTEXT_CONST_PTR(kIonStr);
extern IRTEXT_CONST_PTR(kJkeStr);
extern IRTEXT_CONST_PTR(kKkg29ac1Str);
extern IRTEXT_CONST_PTR(kKkg9ac1Str);
extern IRTEXT_CONST_PTR(kLastStr);
extern IRTEXT_CONST_PTR(kLeftMaxNoSpaceStr);
extern IRTEXT_CONST_PTR(kLeftMaxStr);
Expand Down
7 changes: 7 additions & 0 deletions src/IRutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,13 @@ namespace irutils {
default: return kUnknownStr;
}
break;
case decode_type_t::MIRAGE:
switch (model) {
case mirage_ac_remote_model_t::KKG9AC1: return kKkg9ac1Str;
case mirage_ac_remote_model_t::KKG29AC1: return kKkg29ac1Str;
default: return kUnknownStr;
}
break;
case decode_type_t::PANASONIC_AC:
switch (model) {
case panasonic_ac_remote_model_t::kPanasonicLke: return kLkeStr;
Expand Down
Loading

0 comments on commit 23acd95

Please sign in to comment.