diff --git a/sdk/commands/inputs.ts b/sdk/commands/inputs.ts index a0296a9..b9b5a0b 100644 --- a/sdk/commands/inputs.ts +++ b/sdk/commands/inputs.ts @@ -7,7 +7,7 @@ export type EachSensor = { left: T; }; -export type PanelName = keyof EachPanel; +export type PanelName = keyof EachPanel; export type EachPanel = { up_left: T; diff --git a/sdk/commands/sensor_test.ts b/sdk/commands/sensor_test.ts index 6930b4c..d1edcb7 100644 --- a/sdk/commands/sensor_test.ts +++ b/sdk/commands/sensor_test.ts @@ -135,7 +135,7 @@ export class SMXPanelTestData { /** * These are 16-bit signed integers for the sensor values. * These are signed as they can be negative, but I imagine them going - * negative is just kind of noise from the hardware. + * negative is just kind of noise from the hardware. */ this.sensor_level = { left: data.sensors[0], diff --git a/ui/stage/fsr-panel.tsx b/ui/stage/fsr-panel.tsx index cd68cac..39013df 100644 --- a/ui/stage/fsr-panel.tsx +++ b/ui/stage/fsr-panel.tsx @@ -15,26 +15,10 @@ export function FsrPanel(props: EnabledProps) { active: props.active, })} > - - - - + + + + ); } diff --git a/ui/stage/simple-pad.tsx b/ui/stage/simple-pad.tsx index cef0f49..6be4400 100644 --- a/ui/stage/simple-pad.tsx +++ b/ui/stage/simple-pad.tsx @@ -27,7 +27,7 @@ export function SimplePad({ dev }: Props) { panelStates.down_right, ]); }), - [dev] + [dev], ); return ( diff --git a/ui/stage/stage-test.tsx b/ui/stage/stage-test.tsx index 2999ab5..140e122 100644 --- a/ui/stage/stage-test.tsx +++ b/ui/stage/stage-test.tsx @@ -1,23 +1,14 @@ import { useAtomValue, type Atom } from "jotai"; import { useEffect, useState } from "react"; -import type { - SMXPanelTestData, - SMXSensorTestData, -} from "../../sdk/commands/sensor_test"; +import type { SMXPanelTestData, SMXSensorTestData } from "../../sdk/commands/sensor_test"; import { requestTestData } from "../pad-coms"; import { FsrPanel } from "./fsr-panel"; import { SmxStage } from "../../sdk"; -import { - StageInputs, - type EachPanel, - type PanelName, -} from "../../sdk/commands/inputs"; +import { StageInputs, type EachPanel, type PanelName } from "../../sdk/commands/inputs"; import { HID_REPORT_INPUT_STATE } from "../../sdk/packet"; function useInputState(dev: HIDDevice | undefined) { - const [panelStates, setPanelStates] = useState< - EachPanel | undefined - >(); + const [panelStates, setPanelStates] = useState | undefined>(); useEffect(() => { if (!dev) return; function handleInputReport(e: HIDInputReportEvent) { @@ -67,10 +58,7 @@ export function StageTest({ return null; } - const entries = Object.entries(testData.panels) as [ - PanelName, - SMXPanelTestData - ][]; + const entries = Object.entries(testData.panels) as [PanelName, SMXPanelTestData][]; return (
diff --git a/ui/state.ts b/ui/state.ts index c7fe862..27dcebf 100644 --- a/ui/state.ts +++ b/ui/state.ts @@ -31,4 +31,4 @@ export const statusText$ = atom( ); /** write-only atom. write to this to append a line to statusText */ -export const nextStatusTextLine$ = atom(null, (_, set, line: string) => set(statusText$, (prev) => prev + "\n" + line)); +export const nextStatusTextLine$ = atom(null, (_, set, line: string) => set(statusText$, (prev) => `${prev}\n${line}`)); diff --git a/ui/ui.tsx b/ui/ui.tsx index 509fe69..4bcb7cf 100644 --- a/ui/ui.tsx +++ b/ui/ui.tsx @@ -14,7 +14,7 @@ export function UI() { devices.map((device) => { console.log(`Found device: ${device.productName}`); open_smx_device(device); - }) + }), ); } }, []); @@ -32,11 +32,7 @@ export function UI() { function PickDeviceButton() { return ( - );