mirror of https://github.com/arendst/Tasmota.git
Merge pull request #9969 from s-hadinger/ir_ac_improve
IR fix SAMSUNG_AC
This commit is contained in:
commit
422e0b6bcb
|
@ -2532,9 +2532,11 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
|
||||||
case SAMSUNG_AC:
|
case SAMSUNG_AC:
|
||||||
{
|
{
|
||||||
IRSamsungAc ac(_pin, _inverted, _modulation);
|
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,
|
samsung(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
||||||
send.quiet, send.turbo, send.light, send.filter, send.clean,
|
send.quiet, send.turbo, send.light, send.filter, send.clean,
|
||||||
send.beep, prev->power);
|
send.beep, prev_power);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif // SEND_SAMSUNG_AC
|
#endif // SEND_SAMSUNG_AC
|
||||||
|
|
|
@ -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 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
|
// Below is from IRrecvDumpV2.ino
|
||||||
// As this program is a special purpose capture/decoder, let us use a larger
|
// As this program is a special purpose capture/decoder, let us use a larger
|
||||||
|
@ -463,6 +463,7 @@ uint32_t IrRemoteCmndIrHvacJson(void)
|
||||||
state.sleep = root.getInt(PSTR(D_JSON_IRHVAC_SLEEP), state.sleep);
|
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 (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) {
|
if (stateMode == StateModes::SEND_ONLY || stateMode == StateModes::SEND_STORE) {
|
||||||
IRac ac(Pin(GPIO_IRSEND));
|
IRac ac(Pin(GPIO_IRSEND));
|
||||||
bool success = ac.sendAc(state, irhvac_stateful && irac_prev_state.protocol == state.protocol ? &irac_prev_state : nullptr);
|
bool success = ac.sendAc(state, irhvac_stateful && irac_prev_state.protocol == state.protocol ? &irac_prev_state : nullptr);
|
||||||
|
@ -471,6 +472,7 @@ uint32_t IrRemoteCmndIrHvacJson(void)
|
||||||
if (stateMode == StateModes::STORE_ONLY || stateMode == StateModes::SEND_STORE) { // store state in memory
|
if (stateMode == StateModes::STORE_ONLY || stateMode == StateModes::SEND_STORE) { // store state in memory
|
||||||
irac_prev_state = state;
|
irac_prev_state = state;
|
||||||
}
|
}
|
||||||
|
if (irrecv != nullptr) { irrecv->enableIRIn(); }
|
||||||
|
|
||||||
Response_P(PSTR("{\"" D_CMND_IRHVAC "\":%s}"), sendACJsonState(state).c_str());
|
Response_P(PSTR("{\"" D_CMND_IRHVAC "\":%s}"), sendACJsonState(state).c_str());
|
||||||
return IE_RESPONSE_PROVIDED;
|
return IE_RESPONSE_PROVIDED;
|
||||||
|
|
Loading…
Reference in New Issue