Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRAGE] Experimental detailed support for KKG29A-C1 remote. #1660

Merged
merged 7 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 9 additions & 35 deletions src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1481,39 +1481,10 @@ 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] 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] turbo Run the device in turbo mode.
/// @param[in] light Turn on the Light/Display.
/// @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,
const int16_t sleep, const int16_t clock) {
/// @param[in] state The desired state to send.
void IRac::mirage(IRMirageAc *ac, const stdAc::state_t state) {
ac->begin();

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->setTurbo(turbo);
// No Quiet setting available.
ac->setLight(light);
// No Filter setting available.
// No Clean setting available.
// No Beep setting available.
ac->setSleep(sleep >= 0);
if (clock >= 0) ac->setClock(clock * 60); // Clock is in seconds.
ac->fromCommon(state);
ac->send();
}
#endif // SEND_MIRAGE
Expand Down Expand Up @@ -2526,6 +2497,11 @@ 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:
if (desired.model == mirage_ac_remote_model_t::KKG29AC1)
result.light = desired.light ^ prev->light;
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,9 +2873,7 @@ 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,
send.sleep, send.clock);
mirage(&ac, send);
break;
}
#endif // SEND_MIRAGE
Expand Down
6 changes: 1 addition & 5 deletions src/IRac.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,7 @@ void electra(IRElectraAc *ac,
const bool light, const int16_t sleep = -1);
#endif // SEND_MIDEA
#if SEND_MIRAGE
void 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,
const int16_t sleep = -1, const int16_t clock = -1);
void mirage(IRMirageAc *ac, const stdAc::state_t state);
#endif // SEND_MIRAGE
#if SEND_MITSUBISHI_AC
void mitsubishi(IRMitsubishiAC *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