Skip to content

Commit

Permalink
ToshibaAC: Handle swing messages better.
Browse files Browse the repository at this point in the history
* Try to ignore changing the `IRac` class temp when we get a swing command.
* May fix some upstream implementations & setups. e.g. Tasmota & Home Assistant.
  - Can't hurt at least.

Fixes #1424
  • Loading branch information
crankyoldgit committed Mar 1, 2021
1 parent 0f472b2 commit ea757ac
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/ir_Toshiba.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,18 @@ stdAc::state_t IRToshibaAC::toCommon(const stdAc::state_t *prev) const {
}
result.protocol = decode_type_t::TOSHIBA_AC;
result.model = -1; // Not supported.
result.power = getPower();
result.mode = toCommonMode(getMode());
result.celsius = true;
result.degrees = getTemp();
result.fanspeed = toCommonFanSpeed(getFan());
// Do we have enough current state info to override any previous state?
// i.e. Was the class just setRaw()'ed with a short "swing" message.
// This should enables us to also ignore the Swing msg's special 17C setting.
if (getStateLength() != kToshibaACStateLengthShort) {
result.power = getPower();
result.mode = toCommonMode(getMode());
result.celsius = true;
result.degrees = getTemp();
result.fanspeed = toCommonFanSpeed(getFan());
result.turbo = getTurbo();
result.econo = getEcono();
}
switch (getSwing()) {
case kToshibaAcSwingOn:
result.swingv = stdAc::swingv_t::kAuto;
Expand All @@ -426,8 +433,6 @@ stdAc::state_t IRToshibaAC::toCommon(const stdAc::state_t *prev) const {
break;
default: result.swingv = stdAc::swingv_t::kOff;
}
result.turbo = getTurbo();
result.econo = getEcono();
// Not supported.
result.light = false;
result.filter = false;
Expand Down

0 comments on commit ea757ac

Please sign in to comment.