You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
966 B
27 lines
966 B
package de.games.nanoleaf.server;
|
|
|
|
import java.util.List;
|
|
|
|
import io.github.rowak.nanoleafapi.NanoleafDevice;
|
|
import io.github.rowak.nanoleafapi.util.NanoleafDeviceMeta;
|
|
import io.github.rowak.nanoleafapi.util.NanoleafSetup;
|
|
|
|
public class NanoleafEventServer {
|
|
|
|
|
|
public static void main(String[] args) {
|
|
int timeout = 2000;
|
|
// List<NanoleafDeviceMeta> devices = NanoleafSetup.findNanoleafDevices(timeout);
|
|
// NanoleafDeviceMeta meta = devices.get(0); // Beispiel: Erster Gerät in der Liste
|
|
// String accessToken = NanoleafSetup.createAccessToken(meta.getHostName(), meta.getPort());
|
|
// NanoleafDevice device = NanoleafSetup.createDevice(meta, accessToken);
|
|
//
|
|
// // Event Handling
|
|
// device.setOnStateChangedListener(state -> {
|
|
// System.out.println("State changed: " + state.isOn());
|
|
// });
|
|
|
|
// Weitere Event-Listener hinzufügen, falls erforderlich
|
|
}
|
|
}
|