import type { RailDeckDirectIntegrationClient as Client } from '@raildeck/frontend-sdk/direct-integration'; /** * Read the selected accessory, its state definitions and available types. * @param client - Configured client; the caller owns current authority. * @param accountId - Authorised account for this workflow. * @param layoutId - Explicitly selected layout within the account. * @param accessoryId - Explicitly selected accessory. * @param signal - Caller-owned cancellation signal. * @returns Saved configuration for review; reading it does not move points or change a signal. */ export async function openAccessoryEditor( client: Client, accountId: string, layoutId: string, accessoryId: string, signal: AbortSignal, ) { const options = { signal, timeoutMs: 15_000 }; const accessory = await client.accessories.get(accountId, layoutId, accessoryId, options); const states = await client.accessories.listStates(accountId, layoutId, accessoryId, options); const types = await client.accessories.listTypes(accountId, layoutId); return { accessory, states, types }; }