Skip to content

@mega-yfue/eufy-sdk / classify

Function: classify() ​

ts
function classify(rec): Codec;

Resolve a CloudRecord to its command Codec.

Strategy: trust the cloud-provided numeric DeviceType first (codecForType); if that is absent/unknown, fall back to the model T-code (codecFromModel); if both fail, default to "camera" — the most common eufy-security device and a safe read-only default. Always returns a concrete codec.

Parameters ​

rec ​

CloudRecord

the minimal cloud record slice (deviceType + model are what matter here).

Returns ​

Codec

the resolved codec (never undefined).

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.