Report only real device data and remove unverifiable fields

- Drop simulated-controller fallback: simulation now only runs when
  explicitly enabled in Settings (or outside Tauri), so the app no longer
  claims a controller is connected when none is plugged in
- Derive connection type from the kernel bus type (USB/Bluetooth) instead
  of an unreliable udev property
- Read real battery percentage from /sys/class/power_supply; hide the
  field entirely when the device reports none
- Remove Input mode and Firmware version fields (not obtainable)
- Query virtual controller status from the backend instead of a
  hardcoded per-device flag
- Exclude the app's own uinput virtual controller from device discovery
- Rescan for controllers indefinitely while disconnected so a controller
  plugged in at any time is detected without restarting
- Strip leftover debug instrumentation from the previous session

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-23 08:32:54 -07:00
parent 6507f5f8b3
commit 4286fb1003
16 changed files with 242 additions and 531 deletions

View File

@@ -36,6 +36,7 @@ export const tauriControllerService = {
startReader: (devicePath: string) => invoke<void>("start_device_reader", { devicePath }),
applyRemappingProfile: (profile: Profile) => invoke<void>("apply_remapping_profile", { profile }),
setRemappingEnabled: (enabled: boolean) => invoke<void>("set_remapping_enabled", { enabled }),
virtualControllerActive: () => invoke<boolean>("virtual_controller_active"),
onInput: async (callback: (event: RawInputEvent) => void): Promise<() => void> =>
listen<NativeInputEvent>(INPUT_EVENT, (event) => callback(toRawInputEvent(event.payload))),
onReaderStatus: async (callback: (status: ReaderStatus) => void): Promise<() => void> =>