eufy-mega / model/capabilities / CapabilityAccessors
Type Alias: CapabilityAccessors
ts
type CapabilityAccessors = { [K in keyof DeviceActionMap]?: () => DeviceActionMap[K] | undefined };The fluent capability accessors merged onto Device: dev.ptz?.()?.rotate(PtzDirection.left).
Each accessor is optional, because a device carries only the accessors for capabilities it actually has — a smart light has no camera at all. Calling one that exists still yields undefined until the device is bound to a live transport, so a call site needs ?. twice: dev.ptz?.()?.…, the first for "does this device have it", the second for "is it bound yet".