Skip to content

Commit 1c9a75b

Browse files
authored
[LG] Add support for AKB73757604 model (#1545)
* Support for Vertical Swing on multiple vanes. * Support for Horizontal Swing. * Model detection. * Unit tests added & updated. Fixes #1531
1 parent 89ead22 commit 1c9a75b

File tree

11 files changed

+349
-33
lines changed

11 files changed

+349
-33
lines changed

src/IRac.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,22 +1335,26 @@ void IRac::kelvinator(IRKelvinatorAC *ac,
13351335
/// @param[in] fan The speed setting for the fan.
13361336
/// @param[in] swingv The vertical swing setting.
13371337
/// @param[in] swingv_prev The previous vertical swing setting.
1338+
/// @param[in] swingh The horizontal swing setting.
13381339
/// @param[in] light Turn on the LED/Display mode.
13391340
void IRac::lg(IRLgAc *ac, const lg_ac_remote_model_t model,
13401341
const bool on, const stdAc::opmode_t mode,
13411342
const float degrees, const stdAc::fanspeed_t fan,
13421343
const stdAc::swingv_t swingv, const stdAc::swingv_t swingv_prev,
1343-
const bool light) {
1344+
const stdAc::swingh_t swingh, const bool light) {
13441345
ac->begin();
13451346
ac->setModel(model);
13461347
ac->setPower(on);
13471348
ac->setMode(ac->convertMode(mode));
13481349
ac->setTemp(degrees);
13491350
ac->setFan(ac->convertFan(fan));
13501351
ac->setSwingV(ac->convertSwingV(swingv_prev));
1351-
ac->updateSwingVPrev();
1352+
ac->updateSwingPrev();
13521353
ac->setSwingV(ac->convertSwingV(swingv));
1353-
// No Horizontal swing setting available.
1354+
const uint8_t pos = ac->convertVaneSwingV(swingv);
1355+
for (uint8_t vane = 0; vane < kLgAcSwingVMaxVanes; vane++)
1356+
ac->setVaneSwingV(vane, pos);
1357+
ac->setSwingH(swingh != stdAc::swingh_t::kOff);
13541358
// No Quiet setting available.
13551359
// No Turbo setting available.
13561360
ac->setLight(light);
@@ -2650,7 +2654,8 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
26502654
{
26512655
IRLgAc ac(_pin, _inverted, _modulation);
26522656
lg(&ac, (lg_ac_remote_model_t)send.model, send.power, send.mode,
2653-
send.degrees, send.fanspeed, send.swingv, prev_swingv, send.light);
2657+
send.degrees, send.fanspeed, send.swingv, prev_swingv, send.swingh,
2658+
send.light);
26542659
break;
26552660
}
26562661
#endif // SEND_LG
@@ -3071,6 +3076,8 @@ int16_t IRac::strToModel(const char *str, const int16_t def) {
30713076
return lg_ac_remote_model_t::AKB75215403;
30723077
} else if (!strcasecmp(str, "AKB74955603")) {
30733078
return lg_ac_remote_model_t::AKB74955603;
3079+
} else if (!strcasecmp(str, "AKB73757604")) {
3080+
return lg_ac_remote_model_t::AKB73757604;
30743081
// Panasonic A/C families
30753082
} else if (!strcasecmp(str, "LKE") || !strcasecmp(str, "PANASONICLKE")) {
30763083
return panasonic_ac_remote_model_t::kPanasonicLke;

src/IRac.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ void electra(IRElectraAc *ac,
309309
const bool on, const stdAc::opmode_t mode,
310310
const float degrees, const stdAc::fanspeed_t fan,
311311
const stdAc::swingv_t swingv, const stdAc::swingv_t swingv_prev,
312-
const bool light);
312+
const stdAc::swingh_t swingh, const bool light);
313313
#endif // SEND_LG
314314
#if SEND_MIDEA
315315
void midea(IRMideaAC *ac,

src/IRsend.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ enum lg_ac_remote_model_t {
177177
GE6711AR2853M = 1, // (1) LG 28-bit Protocol (default)
178178
AKB75215403, // (2) LG2 28-bit Protocol
179179
AKB74955603, // (3) LG2 28-bit Protocol variant
180+
AKB73757604, // (4) LG2 Variant of AKB74955603
180181
};
181182

182183

src/IRtext.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ const PROGMEM char* k6thSenseStr = D_STR_6THSENSE; ///< "6th Sense"
9999
const PROGMEM char* kTypeStr = D_STR_TYPE; ///< "Type"
100100
const PROGMEM char* kSpecialStr = D_STR_SPECIAL; ///< "Special"
101101
const PROGMEM char* kIdStr = D_STR_ID; ///< "Id" / Device Identifier
102+
const PROGMEM char* kVaneStr = D_STR_VANE; ///< "Vane"
102103

103104
const PROGMEM char* kAutoStr = D_STR_AUTO; ///< "Auto"
104105
const PROGMEM char* kAutomaticStr = D_STR_AUTOMATIC; ///< "Automatic"

src/IRtext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ extern const char* kTypeStr;
156156
extern const char* kUnknownStr;
157157
extern const char* kUpperStr;
158158
extern const char* kUpStr;
159+
extern const char* kVaneStr;
159160
extern const char* kWallStr;
160161
extern const char* kWeeklyTimerStr;
161162
extern const char* kWideStr;

src/IRutils.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,9 @@ namespace irutils {
578578
case decode_type_t::LG2:
579579
switch (model) {
580580
case lg_ac_remote_model_t::GE6711AR2853M: return F("GE6711AR2853M");
581-
case lg_ac_remote_model_t::AKB75215403: return F("AKB75215403");
582-
case lg_ac_remote_model_t::AKB74955603: return F("AKB74955603");
581+
case lg_ac_remote_model_t::AKB75215403: return F("AKB75215403");
582+
case lg_ac_remote_model_t::AKB74955603: return F("AKB74955603");
583+
case lg_ac_remote_model_t::AKB73757604: return F("AKB73757604");
583584
default: return kUnknownStr;
584585
}
585586
break;

0 commit comments

Comments
 (0)