   opcServer.setClientConnectedCallback(cbOpcClientConnected);
   opcServer.setClientDisconnectedCallback(cbOpcClientDisconnected);
   opcServer.begin();
-  opcServer.mDNSBegin("Blume-ESP32-OPC");
-#endif
+  opcServer.mDNSBegin("blume");
+#endif
+
+#if ENCODER
+  pinMode(ENC_SW, INPUT_PULLUP);
+  attachInterrupt(digitalPinToInterrupt(ENC_SW), encoderSwitchHandler, CHANGE);
+  // Make sure we're in sync with current switch state.
+  encoderSwitchHandler();
+#endif // ENCODER
     
   pinMode(DATA_PIN_0, OUTPUT);
   pinMode(CLOCK_PIN_0, OUTPUT);

    }
#endif
  }

  /*Serial.print(len);
  Serial.print(F(" -> "));*/
  // We have new settings! Apply them.
  if (restoreFromSettings(false)) {
    // Plan to save this if we don't get any more data
    saveTarget = millis() + EEPROM_SAVE_TIMEOUT_MS;
  }
}

void checkSave() {

  }
}

// Positions should really be uint16_ts,
// but we're about to do arithmetic with them that wants negative results.
float distance(float pos1, float pos2, float dimensionSize) {
  float distance = abs(pos1 - pos2);
  while (distance > dimensionSize) distance -= dimensionSize;
