mirror of https://github.com/arendst/Tasmota.git
Allow IR messages with a data payload of zero.
Ref: Issue #2751 Incorrect assumption that if the result of `strtoul()` is zero (0) it is a parse failure. That's incorrect as the "data" payload could actually be 0. Ref: https://github.com/markszabo/IRremoteESP8266/issues/447#issuecomment-389745404
This commit is contained in:
parent
25ba74cfb4
commit
4b72080b6d
|
@ -298,7 +298,7 @@ boolean IrSendCommand()
|
|||
protocol = root[UpperCase_P(parm_uc, PSTR(D_JSON_IR_PROTOCOL))];
|
||||
bits = root[UpperCase_P(parm_uc, PSTR(D_JSON_IR_BITS))];
|
||||
data = strtoul(root[UpperCase_P(parm_uc, PSTR(D_JSON_IR_DATA))], NULL, 0);
|
||||
if (protocol && bits && data) {
|
||||
if (protocol && bits) {
|
||||
int protocol_code = GetCommandCode(protocol_text, sizeof(protocol_text), protocol, kIrRemoteProtocols);
|
||||
|
||||
snprintf_P(log_data, sizeof(log_data), PSTR("IRS: protocol_text %s, protocol %s, bits %d, data %u (0x%lX), protocol_code %d"),
|
||||
|
|
Loading…
Reference in New Issue