2727#define D_JSON_RF_BITS " Bits"
2828#define D_JSON_RF_DATA " Data"
2929
30- #define D_CMND_RFSEND " RFSend"
31- #define D_CMND_RFPROTOCOL " RfProtocol"
30+ #define D_CMND_RFSEND " Send"
31+ #define D_CMND_RFPROTOCOL " Protocol"
32+ #define D_CMND_RFTIMEOUT " TimeOut"
3233
3334#define D_JSON_RF_PULSE " Pulse"
3435#define D_JSON_RF_REPEAT " Repeat"
3536#define D_JSON_NONE_ENABLED " None Enabled"
3637
37- const char kRfCommands [] PROGMEM = " |" // No prefix
38- D_CMND_RFSEND " |" D_CMND_RFPROTOCOL ;
38+ const char kRfCommands [] PROGMEM = " Rf |" // No prefix
39+ D_CMND_RFSEND " |" D_CMND_RFPROTOCOL " | " D_CMND_RFTIMEOUT ;
3940
4041void (* const RfCommands[])(void ) PROGMEM = {
41- &CmndRfSend, &CmndRfProtocol };
42+ &CmndRfSend, &CmndRfProtocol, &CmndRfTimeOut };
4243
4344#include < RCSwitch.h>
4445
@@ -59,7 +60,7 @@ void RfReceiveCheck(void) {
5960 AddLog (LOG_LEVEL_DEBUG , PSTR (" RFR: Data 0x%lX (%u), Bits %d, Protocol %d, Delay %d" ), data, data, bits, protocol, delay);
6061
6162 uint32_t now = millis ();
62- if ((now - rf_lasttime > RF_TIME_AVOID_DUPLICATE ) && (data > 0 )) {
63+ if ((now - rf_lasttime > Settings-> rf_duplicate_time ) && (data > 0 )) {
6364 rf_lasttime = now;
6465
6566 char stemp[16 ];
@@ -84,6 +85,9 @@ void RfInit(void) {
8485 mySwitch.enableTransmit (Pin (GPIO_RFSEND ));
8586 }
8687 if (PinUsed (GPIO_RFRECV )) {
88+ if (Settings->rf_duplicate_time < 10 ) {
89+ Settings->rf_duplicate_time = RF_TIME_AVOID_DUPLICATE ;
90+ }
8791 pinMode ( Pin (GPIO_RFRECV ), INPUT );
8892 mySwitch.enableReceive (Pin (GPIO_RFRECV ));
8993 if (!Settings->rf_protocol_mask ) {
@@ -214,6 +218,13 @@ void CmndRfSend(void)
214218 }
215219}
216220
221+ void CmndRfTimeOut (void ) {
222+ if (XdrvMailbox.payload >= 10 ) {
223+ Settings->rf_duplicate_time = XdrvMailbox.payload ;
224+ }
225+ ResponseCmndNumber (Settings->rf_duplicate_time );
226+ }
227+
217228/* ********************************************************************************************\
218229 * Interface
219230\*********************************************************************************************/
0 commit comments