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

int lastbuttonState = -1;
int ledState = 0;
int LEDfunction = 0;

Bounce debouncer = Bounce(); // Bounce is built into Homie, so you can use it without including it first


  // Update button state
  button1.Update();

  // Save click codes in function, as click codes are reset at next Update()
  if(button1.clicks != 0) function = button1.clicks;

  if(function == 1) Serial.println("SINGLE click");

  if(function == 2) Serial.println("DOUBLE click");

  if(function == 3) Serial.println("TRIPLE click");

  if(function == -1) Serial.println("SINGLE LONG click");

  if(function == -2) Serial.println("DOUBLE LONG click");

  if(function == -3) Serial.println("TRIPLE LONG click");

  if ( function > 0 ) {
    // One shot message
    Serial.println("Resetting");
    function = 0;
  }

  if ( function < 0 ) {
    // Repeat messages until released.
    // Will likely need to rate limit repeat message publishing
    Serial.println("Held");
  }

  delay(5);

}

void setup() {
