   Serial.print(" with protocol ");
   Serial.println(protocol);
 
-  if(protocol == "RAW") {
+  if (protocol == "RAW") {
     int rawpulses[MAXPULSESTREAMLENGTH];
     int rawlen = rf.stringToPulseTrain(message, rawpulses, MAXPULSESTREAMLENGTH);
-    if(rawlen > 0) {
+    if (rawlen > 0) {
       rf.sendPulseTrain(rawpulses, rawlen);
     }
   } else {

  Serial.print(repeats);
  Serial.println(")");

  if(status==VALID) {
    String topic = globalTopic + String("/recv/") + protocol;
    if (deviceID != NULL) {
      topic += String('/') + deviceID;
    }
    mqtt.publish(topic.c_str(), message.c_str(), true);
  }
  if(logMode) {
    String topic = mainTopic + String("/log/") + String(status) + String('/') + protocol;
    mqtt.publish(topic.c_str(), message.c_str());
  }
}

void rfRawCallback(const int* pulses, int length) {
  if(rawMode) {
    String data = rf.pulseTrainToString(pulses, length);
    if(data.length()>0) {
      Serial.print("RAW RF signal (");
      Serial.print(length);
      Serial.print("): ");

ESPiLight rf(TRANSMITTER_PIN);
SHAauth otaAuth(myOTA_PASSWD);

const String mainTopic = String("rfESP_") + String(ESP.getChipId(), HEX);
const String globalTopic = "rf434";
boolean logMode = false;
boolean rawMode = false;
