Skip to content

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".

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations or eufy. "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.