   switch (cmd) {
     case CMD_WAIT:
       break;
-    case CMD_BUTTON_CHANGE:
+    case CMD_BUTTON_CHANGE: {
       int currentState = digitalRead(SONOFF_BUTTON);
       if (currentState != buttonState) {
         if (buttonState == LOW && currentState == HIGH) {


  //setup input
  pinMode(SONOFF_INPUT, INPUT);
  attachInterrupt(SONOFF_BUTTON, toggleInputState, CHANGE);

  //setup relay
  //TODO multiple relays

          startPress = millis();
        }
        buttonState = currentState;
      }}
      break;

  }
