 #include <Homie.h>
 
 #define FW_NAME "homie-sonoff-touch"
-#define FW_VERSION "2.0.1"
+#define FW_VERSION "2.0.2"
 
 /* Magic sequence for Autodetectable Binary Upload */
 const char *__FLAGGED_FW_NAME = "\xbf\x84\xe4\x13\x54" FW_NAME "\x93\x44\x6b\xa7\x75";

    Serial.println("One-shot");
    if ( function == 1 ) {
      Serial.println("SINGLE click");
      buttonNode.setProperty("event").send("SINGLE");
    }

    if ( function == 2 ) {
      buttonNode.setProperty("event").send("DOUBLE");
      Serial.println("DOUBLE click");
    }

    if ( function == 3 ) {
      buttonNode.setProperty("event").send("TRIPLE");
      Serial.println("TRIPLE click");
    }
    // This has been a single event.

    if ( millis() - previousMillis >= waitInterval ) {
      previousMillis = millis();
      if ( function == -1 ) {
        buttonNode.setProperty("event").setRetained(false).send("SINGLEHELD");
        Serial.println("SINGLE LONG click");
      }

      if ( function == -2 ) {
        buttonNode.setProperty("event").setRetained(false).send("DOUBLEHELD");
        Serial.println("DOUBLE LONG click");
      }

      if ( function == -3 ) {
        buttonNode.setProperty("event").setRetained(false).send("TRIPLEHELD");
        Serial.println("TRIPLE LONG click");
      }
    }
