diff --git a/packages/frontend/src/routes/play/+page.svelte b/packages/frontend/src/routes/play/+page.svelte index 3260e1a..1ef7096 100644 --- a/packages/frontend/src/routes/play/+page.svelte +++ b/packages/frontend/src/routes/play/+page.svelte @@ -127,10 +127,10 @@ recordedEvents.push({ timestamp, - deviceIndex: device.info.index, - deviceName: device.name, - actuatorIndex: actuatorIdx, - actuatorType: actuator.outputType, + device_index: device.info.index, + device_name: device.name, + actuator_index: actuatorIdx, + actuator_type: actuator.outputType, value: (value / actuator.maxSteps) * 100, // Normalize to 0-100 }); } @@ -313,16 +313,16 @@ function executeEvent(event: RecordedEvent) { // Get mapped device - const device = deviceMappings.get(event.deviceName); + const device = deviceMappings.get(event.device_name); if (!device) { - console.warn(`No device mapping for: ${event.deviceName}`); + console.warn(`No device mapping for: ${event.device_name}`); return; } // Find matching actuator by type - const actuator = device.actuators.find((a) => a.outputType === event.actuatorType); + const actuator = device.actuators.find((a) => a.outputType === event.actuator_type); if (!actuator) { - console.warn(`Actuator type ${event.actuatorType} not found on ${device.name}`); + console.warn(`Actuator type ${event.actuator_type} not found on ${device.name}`); return; } diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index c3fab0a..4b129db 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -140,10 +140,10 @@ export interface Stats { export interface RecordedEvent { timestamp: number; - deviceIndex: number; - deviceName: string; - actuatorIndex: number; - actuatorType: string; + device_index: number; + device_name: string; + actuator_index: number; + actuator_type: string; value: number; }