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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user