import type { AccessControlDevice, DeviceHealth } from "../interfaces.js"; import type { AccessDriver, DeviceConfig } from "../registry.js"; import { stubLog } from "./common.js"; // Stub access controller — a no-op barrier for BENCH TESTING the entry/exit/permit // flows without real relay hardware. `pulseOpen` just logs "intent to open"; it // performs no device I/O, so it can stand in on a lane while the real // [[dingtian-relay]] isn't connected. NOT for production. See first-run-setup.md. class StubAccess implements AccessControlDevice { readonly driverId = "stub-access"; constructor(_config: DeviceConfig) {} async connect(): Promise {} async disconnect(): Promise {} async healthCheck(): Promise { return { status: "ready", detail: "stub (no real barrier)" }; } async pulseOpen(doorId: number): Promise { stubLog(this.driverId, `pulseOpen door ${doorId} (stub — no relay fired)`); } async getDoorStatus(): Promise<"open" | "closed"> { return "closed"; } } export const stubAccessDriver: AccessDriver = { id: "stub-access", category: "access", label: "Stub barrier (bench testing — no relay)", description: "A no-op access controller for testing the flows without hardware. pulseOpen only logs; no relay is fired. Not for production.", transports: ["tcp-ip"], configFields: [], create: (c) => new StubAccess(c), };