Configurable amount of RF2 repeats (#990)
* Make number of RF2 repeats configurable * Reduce number of repeats Number of repeats in NewRemoteTransmitter is by default 16, which takes quite some time to send. It actually runs 2^R repeats, where R is the configured amount. https://github.com/1technophile/NewRemoteSwitch/blob/86f1c8486c80919ef70e86504e8a9580c34b4fab/NewRemoteTransmitter.cpp#L20
This commit is contained in:
1 parent
e14a78e9c0
commit
f84a878400
2 files changed
+4
-3
No files matched your search
@@ -210,7 +210,7 @@ void MQTTtoRF2(char* topicOri, char* datacallback) {
|
|||||||
valuePERIOD = 272;
|
valuePERIOD = 272;
|
||||||
NewRemoteReceiver::disable();
|
NewRemoteReceiver::disable();
|
||||||
Log.trace(F("Creating transmitter" CR));
|
Log.trace(F("Creating transmitter" CR));
|
||||||
NewRemoteTransmitter transmitter(valueCODE, RF_EMITTER_GPIO, valuePERIOD);
|
NewRemoteTransmitter transmitter(valueCODE, RF_EMITTER_GPIO, valuePERIOD, RF2_EMITTER_REPEAT);
|
||||||
Log.trace(F("Sending data" CR));
|
Log.trace(F("Sending data" CR));
|
||||||
if (valueGROUP) {
|
if (valueGROUP) {
|
||||||
if (isDimCommand) {
|
if (isDimCommand) {
|
||||||
@@ -287,7 +287,7 @@ void MQTTtoRF2(char* topicOri, JsonObject& RF2data) { // json object decoding
|
|||||||
if (valuePERIOD == 0)
|
if (valuePERIOD == 0)
|
||||||
valuePERIOD = 272;
|
valuePERIOD = 272;
|
||||||
NewRemoteReceiver::disable();
|
NewRemoteReceiver::disable();
|
||||||
NewRemoteTransmitter transmitter(valueCODE, RF_EMITTER_GPIO, valuePERIOD);
|
NewRemoteTransmitter transmitter(valueCODE, RF_EMITTER_GPIO, valuePERIOD, RF2_EMITTER_REPEAT);
|
||||||
Log.trace(F("Sending" CR));
|
Log.trace(F("Sending" CR));
|
||||||
if (valueGROUP) {
|
if (valueGROUP) {
|
||||||
if (isDimCommand) {
|
if (isDimCommand) {
|
||||||
|
|||||||
+2
-1
@@ -79,7 +79,8 @@ int minimumRssi = 0;
|
|||||||
// subject monitored to listen traffic processed by other gateways to store data and avoid ntuple
|
// subject monitored to listen traffic processed by other gateways to store data and avoid ntuple
|
||||||
#define subjectMultiGTWRF "+/+/433toMQTT"
|
#define subjectMultiGTWRF "+/+/433toMQTT"
|
||||||
//RF number of signal repetition - Can be overridden by specifying "repeat" in a JSON message.
|
//RF number of signal repetition - Can be overridden by specifying "repeat" in a JSON message.
|
||||||
#define RF_EMITTER_REPEAT 20
|
#define RF_EMITTER_REPEAT 20
|
||||||
|
#define RF2_EMITTER_REPEAT 2 // Actual repeats is 2^R, where R is the here configured amount
|
||||||
//#define RF_DISABLE_TRANSMIT //Uncomment this line to disable RF transmissions. (RF Receive will work as normal.)
|
//#define RF_DISABLE_TRANSMIT //Uncomment this line to disable RF transmissions. (RF Receive will work as normal.)
|
||||||
//#define RFmqttDiscovery true //uncomment this line so as to create a discovery switch for each RF signal received
|
//#define RFmqttDiscovery true //uncomment this line so as to create a discovery switch for each RF signal received
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user