Skip to content

@mega-yfue/eufy-sdk / inferName

Function: inferName()

ts
function inferName(rec): string | undefined;

Best-effort display name from a cloud record. Prefers a clean uppercase model T-code (e.g. "T8423"); falls back to undefined. Never throws.

A "clean model code" is the eufy product-code shape: a leading letter (usually T) plus digits, optionally with a short alphanumeric suffix. We normalise case and trim noise; if the model doesn't look like a code at all we return undefined rather than echoing junk.

Parameters

rec

CloudRecord

The cloud device record.

Returns

string | undefined

The normalised model code, or undefined when none is usable.

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.