Skip to content

Commit

Permalink
Kelon: Handle toggles in toCommon()
Browse files Browse the repository at this point in the history
  • Loading branch information
depau committed Jul 2, 2021
1 parent 792025f commit 8a33fca
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ir_Kelon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,13 @@ stdAc::state_t IRKelonAc::toCommon(const stdAc::state_t *prev) const {
result.sleep = getSleep() ? 0 : -1;
// Not supported.
// N/A, AC only supports toggling it
result.power = prev == nullptr || prev->power;
result.power = (prev == nullptr || prev->power) ^ _.PowerToggle;
// N/A, AC only supports toggling it
result.swingv = prev != nullptr ? prev->swingv : stdAc::swingv_t::kAuto;
// N/A, horizontal air direction can only be set by manually adjusting it
result.swingv = stdAc::swingv_t::kAuto;
if (prev != nullptr &&
(prev->swingv == stdAc::swingv_t::kAuto) ^ _.SwingVToggle) {
result.swingv = stdAc::swingv_t::kOff;
}
result.swingh = stdAc::swingh_t::kOff;
result.light = true;
result.beep = true;
Expand Down

0 comments on commit 8a33fca

Please sign in to comment.