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({
|
recordedEvents.push({
|
||||||
timestamp,
|
timestamp,
|
||||||
deviceIndex: device.info.index,
|
device_index: device.info.index,
|
||||||
deviceName: device.name,
|
device_name: device.name,
|
||||||
actuatorIndex: actuatorIdx,
|
actuator_index: actuatorIdx,
|
||||||
actuatorType: actuator.outputType,
|
actuator_type: actuator.outputType,
|
||||||
value: (value / actuator.maxSteps) * 100, // Normalize to 0-100
|
value: (value / actuator.maxSteps) * 100, // Normalize to 0-100
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -313,16 +313,16 @@
|
|||||||
|
|
||||||
function executeEvent(event: RecordedEvent) {
|
function executeEvent(event: RecordedEvent) {
|
||||||
// Get mapped device
|
// Get mapped device
|
||||||
const device = deviceMappings.get(event.deviceName);
|
const device = deviceMappings.get(event.device_name);
|
||||||
if (!device) {
|
if (!device) {
|
||||||
console.warn(`No device mapping for: ${event.deviceName}`);
|
console.warn(`No device mapping for: ${event.device_name}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find matching actuator by type
|
// 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) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -140,10 +140,10 @@ export interface Stats {
|
|||||||
|
|
||||||
export interface RecordedEvent {
|
export interface RecordedEvent {
|
||||||
timestamp: number;
|
timestamp: number;
|
||||||
deviceIndex: number;
|
device_index: number;
|
||||||
deviceName: string;
|
device_name: string;
|
||||||
actuatorIndex: number;
|
actuator_index: number;
|
||||||
actuatorType: string;
|
actuator_type: string;
|
||||||
value: number;
|
value: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user