Skip to content

@mega-yfue/eufy-sdk / AnyDeviceEvent

Type Alias: AnyDeviceEvent

ts
type AnyDeviceEvent = { [K in keyof DeviceEventMap]: DeviceEventMap[K] & { eventName: K } }[keyof DeviceEventMap];

A single semantic event tagged with its name — the payload of the catch-all "event" listener. A discriminated union over DeviceEventMap, so switching on e.eventName narrows e to that event's payload.

The tag is eventName, not name: an event payload may legitimately carry its own name field, and overwriting it to tag the event would destroy data. Matches the eventName carried on a push event.

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