Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix send IRSend for Pioneer devices (#6100) #6119

Merged
merged 2 commits into from
Jul 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sonoff/_changelog.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions sonoff/my_user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 27 additions & 1 deletion sonoff/xdrv_05_irremote.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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);
Expand Down