Skip to content

@mega-yfue/eufy-sdk / codecFromModel

Function: codecFromModel() ​

ts
function codecFromModel(model): Codec | undefined;

Fallback classifier used when CloudRecord.deviceType is absent. Matches eufy product T-codes by family prefix. Deliberately conservative — it only claims a codec when the T-code range is a strong, unambiguous family signal; otherwise it returns undefined and lets classify apply the camera default.

Known T-code families (case-insensitive):

  • T85xx / T852x / T850x → lock (Smart Lock R-series, video lock, etc.), EXCEPT T8520-prefixed which can be lock variants — still lock.
  • T74xx → lock (SmartSafe 7400-series).
  • T80xx / T8001 / T8002 / T8010 / T8030 / T8023 / T8025 → station (HomeBase / HomeBase 2 / 3 / Mini), T9000 (the app's own model registry files it as family STATION_9000, the one station family outside the T8 band), and T8N00 (NVR) → station.
  • T89xx (entry/motion/water/siren sensors, e.g. T8900/T8910/T8920) → sensor.
  • T87xx keypad (T8960) → keypad.
  • any other T8… security T-code → camera (the default security family).

Parameters ​

model ​

string | undefined

product/model code (T-code), e.g. "T8423". undefined/empty → undefined.

Returns ​

Codec | undefined

the inferred codec, or undefined when the code is unrecognised.

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.