Skip to content

Commit

Permalink
Merge pull request #9969 from s-hadinger/ir_ac_improve
Browse files Browse the repository at this point in the history
IR fix SAMSUNG_AC
  • Loading branch information
arendst authored Nov 24, 2020
2 parents 547e5d9 + 00d7cd1 commit 422e0b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/lib_basic/IRremoteESP8266-2.7.12/src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2532,9 +2532,11 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
case SAMSUNG_AC:
{
IRSamsungAc ac(_pin, _inverted, _modulation);
bool prev_power = !send.power;
if (prev != NULL) prev_power = prev->power;
samsung(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
send.quiet, send.turbo, send.light, send.filter, send.clean,
send.beep, prev->power);
send.beep, prev_power);
break;
}
#endif // SEND_SAMSUNG_AC
Expand Down
4 changes: 3 additions & 1 deletion tasmota/xdrv_05_irremote_full.ino
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ uint64_t reverseBitsInBytes64(uint64_t b) {
\*********************************************************************************************/

const bool IR_FULL_RCV_SAVE_BUFFER = false; // false = do not use buffer, true = use buffer for decoding
const uint32_t IR_TIME_AVOID_DUPLICATE = 500; // Milliseconds
const uint32_t IR_TIME_AVOID_DUPLICATE = 50; // Milliseconds

// Below is from IRrecvDumpV2.ino
// As this program is a special purpose capture/decoder, let us use a larger
Expand Down Expand Up @@ -463,6 +463,7 @@ uint32_t IrRemoteCmndIrHvacJson(void)
state.sleep = root.getInt(PSTR(D_JSON_IRHVAC_SLEEP), state.sleep);
//if (json[D_JSON_IRHVAC_CLOCK]) { state.clock = json[D_JSON_IRHVAC_CLOCK]; } // not sure it's useful to support 'clock'

if (irrecv != nullptr) { irrecv->disableIRIn(); }
if (stateMode == StateModes::SEND_ONLY || stateMode == StateModes::SEND_STORE) {
IRac ac(Pin(GPIO_IRSEND));
bool success = ac.sendAc(state, irhvac_stateful && irac_prev_state.protocol == state.protocol ? &irac_prev_state : nullptr);
Expand All @@ -471,6 +472,7 @@ uint32_t IrRemoteCmndIrHvacJson(void)
if (stateMode == StateModes::STORE_ONLY || stateMode == StateModes::SEND_STORE) { // store state in memory
irac_prev_state = state;
}
if (irrecv != nullptr) { irrecv->enableIRIn(); }

Response_P(PSTR("{\"" D_CMND_IRHVAC "\":%s}"), sendACJsonState(state).c_str());
return IE_RESPONSE_PROVIDED;
Expand Down

0 comments on commit 422e0b6

Please sign in to comment.