mirror of https://github.com/arendst/Tasmota.git
if pulse is not specified, let the lib use its default value
This commit is contained in:
parent
87d42e15d5
commit
2488018379
|
@ -157,7 +157,7 @@ void CmndRfSend(void)
|
||||||
unsigned int bits = 24;
|
unsigned int bits = 24;
|
||||||
int protocol = 1;
|
int protocol = 1;
|
||||||
int repeat = 10;
|
int repeat = 10;
|
||||||
int pulse = 350;
|
int pulse = 0; // 0 leave the library use the default value depending on protocol
|
||||||
|
|
||||||
JsonParser parser(XdrvMailbox.data);
|
JsonParser parser(XdrvMailbox.data);
|
||||||
JsonParserObject root = parser.getRootObject();
|
JsonParserObject root = parser.getRootObject();
|
||||||
|
@ -195,8 +195,8 @@ void CmndRfSend(void)
|
||||||
|
|
||||||
if (!protocol) { protocol = 1; }
|
if (!protocol) { protocol = 1; }
|
||||||
mySwitch.setProtocol(protocol);
|
mySwitch.setProtocol(protocol);
|
||||||
if (!pulse) { pulse = 350; } // Default pulse length for protocol 1
|
// if pulse is specified in the command, enforce the provided value (otherwise lib takes default)
|
||||||
mySwitch.setPulseLength(pulse);
|
if (!pulse) { mySwitch.setPulseLength(pulse); }
|
||||||
if (!repeat) { repeat = 10; } // Default at init
|
if (!repeat) { repeat = 10; } // Default at init
|
||||||
mySwitch.setRepeatTransmit(repeat);
|
mySwitch.setRepeatTransmit(repeat);
|
||||||
if (!bits) { bits = 24; } // Default 24 bits
|
if (!bits) { bits = 24; } // Default 24 bits
|
||||||
|
|
Loading…
Reference in New Issue