refactor: rename RecordedEvent fields to snake_case

deviceIndex → device_index
deviceName → device_name
actuatorIndex → actuator_index
actuatorType → actuator_type

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 11:04:36 +01:00
parent 97269788ee
commit 9bef2469d1
2 changed files with 12 additions and 12 deletions

View File

@@ -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;
}

View File

@@ -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;
}