return;
}
DiscoveryResultBuilder result = DiscoveryResultBuilder.create(new ThingUID(THING_TYPE_DEVICE, file.getName()))
- .withProperty("path", file.getAbsolutePath()).withRepresentationProperty(file.getName());
+ .withProperty("path", file.getAbsolutePath()).withRepresentationProperty("path");
if (ttl != null) {
result = result.withTTL(ttl.getSeconds());
}
String labelFromDevice = device.getName();
boolean isKeyboard = device.has(EvdevLibrary.Type.KEY);
if (labelFromDevice != null) {
- label = labelFromDevice;
+ label = String.format("%s (%s)", labelFromDevice, inputDevice.getName());
}
return isKeyboard;
} finally {
private WatchService makeWatcher() throws IOException {
WatchService watchService = FileSystems.getDefault().newWatchService();
+ // FIXME also trigger on inotify "ATTRIB" events when WatchService supports this.
+ // Triggering on ENTRY_MODIFY will trigger multiple times on each keypress for *any* input device.
DEVICE_DIRECTORY.register(watchService, StandardWatchEventKinds.ENTRY_CREATE,
- StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY);
+ StandardWatchEventKinds.ENTRY_DELETE);
return watchService;
}