@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
The cloud device record.
Returns
string | undefined
The normalised model code, or undefined when none is usable.