@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.), EXCEPTT8520-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), andT8N00(NVR) /T8E00(PoE NVR) → station.T89xx(entry/motion/water/siren sensors, e.g. T8900/T8910/T8920) → sensor.T87xxkeypad (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.