From b2cb4845b86392e5253b0a9bc2ee8ae91d84dfa0 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 30 Oct 2020 23:22:49 +0100 Subject: [PATCH] Fix missing error when unsupported protocol --- tasmota/xdrv_05_irremote.ino | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_05_irremote.ino b/tasmota/xdrv_05_irremote.ino index cbb340d64..bcca685c5 100644 --- a/tasmota/xdrv_05_irremote.ino +++ b/tasmota/xdrv_05_irremote.ino @@ -62,7 +62,7 @@ def ir_expand(ir_compact): #include #include -enum IrErrors { IE_NO_ERROR, IE_INVALID_RAWDATA, IE_INVALID_JSON, IE_SYNTAX_IRSEND }; +enum IrErrors { IE_NO_ERROR, IE_INVALID_RAWDATA, IE_INVALID_JSON, IE_SYNTAX_IRSEND, IE_PROTO_UNSUPPORTED }; const char kIrRemoteCommands[] PROGMEM = "|" D_CMND_IRSEND ; @@ -307,7 +307,7 @@ uint32_t IrRemoteCmndIrSendJson(void) #endif default: irsend_active = false; - ResponseCmndChar(D_JSON_PROTOCOL_NOT_SUPPORTED); + return IE_PROTO_UNSUPPORTED; } return IE_NO_ERROR; @@ -336,6 +336,9 @@ void IrRemoteCmndResponse(uint32_t error) case IE_INVALID_JSON: ResponseCmndChar_P(PSTR(D_JSON_INVALID_JSON)); break; + case IE_PROTO_UNSUPPORTED: + ResponseCmndChar(D_JSON_PROTOCOL_NOT_SUPPORTED); + break; case IE_SYNTAX_IRSEND: Response_P(PSTR("{\"" D_CMND_IRSEND "\":\"" D_JSON_NO " " D_JSON_IR_PROTOCOL ", " D_JSON_IR_BITS " " D_JSON_OR " " D_JSON_IR_DATA "\"}")); break;