diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index b93a6ee815ff..052cedd7a7a3 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -5,6 +5,7 @@ * Add command SetOption67 0/1 to disable or enable a buzzer as used in iFan03 * Add support IRSend long press ('repeat' feature from IRRemoteESP8266) (#6074) * Add support for optional IRHVAC Midea/Komeco protocol (#3227) + * Fix IRSend for Pioneer devices (#6100) * * 6.6.0.1 20190708 * Fix Domoticz battery level set to 100 if define USE_ADC_VCC is not used (#6033) diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index ac2c7e7e033c..a4b9416ca3e2 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -443,6 +443,7 @@ // #define USE_IR_SEND_SHARP // Support IRsend Sharp protocol #define USE_IR_SEND_SONY // Support IRsend Sony protocol // #define USE_IR_SEND_WHYNTER // Support IRsend Whynter protocol + #define USE_IR_SEND_PIONEER // Support IRsend Pioneer protocol // #define USE_IR_HVAC // Support for HVAC systems using IR (+3k5 code) #define USE_IR_HVAC_TOSHIBA // Support IRhvac Toshiba protocol diff --git a/sonoff/xdrv_05_irremote.ino b/sonoff/xdrv_05_irremote.ino index 208d4b097abe..05e6d6a8f8a5 100644 --- a/sonoff/xdrv_05_irremote.ino +++ b/sonoff/xdrv_05_irremote.ino @@ -32,8 +32,19 @@ enum IrRemoteCommands { CMND_IRSEND, CMND_IRHVAC }; const char kIrRemoteCommands[] PROGMEM = D_CMND_IRSEND "|" D_CMND_IRHVAC ; // Based on IRremoteESP8266.h enum decode_type_t +static const uint8_t MAX_STANDARD_IR = SHARP; // this is the last code mapped to decode_type_t +enum IrVendors { IR_BASE = MAX_STANDARD_IR, +#ifdef USE_IR_SEND_PIONEER + IR_PIONEER, +#endif // USE_IR_SEND_PIONEER +}; const char kIrRemoteProtocols[] PROGMEM = - "UNKNOWN|RC5|RC6|NEC|SONY|PANASONIC|JVC|SAMSUNG|WHYNTER|AIWA_RC_T501|LG|SANYO|MITSUBISHI|DISH|SHARP"; + "UNKNOWN|RC5|RC6|NEC|SONY|PANASONIC|JVC|SAMSUNG|WHYNTER|AIWA_RC_T501|LG|SANYO|MITSUBISHI|DISH|SHARP" + // now allow for other codes beyond the first series; +#ifdef USE_IR_SEND_PIONEER + "|PIONEER" +#endif // USE_IR_SEND_PIONEER + ; #ifdef USE_IR_HVAC @@ -890,6 +901,21 @@ bool IrSendCommand(void) case SHARP: irsend->sendSharpRaw(data, bits, repeat); break; #endif +#ifdef USE_IR_SEND_PIONEER + case IR_PIONEER: + for (int32_t r=repeat; r>=0; r--) { + if (bits > 32) { + irsend->sendGeneric(8500,4250,540,1600,540,540,540,25000,85000, + (data>>32),bits-32,40,true,0,33); + } + irsend->sendGeneric(8500,4250,540,1600,540,540,540,25000,85000, + data, bits > 32 ? 32 : bits, + 40,true,0,33); + } + break; + // waiting for timing patch to be integrated in + //irsend->sendPioneer(data, bits, repeat); break; +#endif // USE_IR_SEND_PIONEER default: irsend_active = false; Response_P(S_JSON_COMMAND_SVALUE, command, D_JSON_PROTOCOL_NOT_SUPPORTED);