Skip to content

@mega-yfue/eufy-sdk / parseSecureTopic

Function: parseSecureTopic()

ts
function parseSecureTopic(topic): ParsedTopic | undefined;

Split an inbound topic into its parts. All roots this broker uses (cmd/…, synq/…, biz/…, dt/…) put the serial at index 3 regardless of how deep the tail runs, so the serial is read positionally rather than from the end — …/<sn>/app/res and …/<sn>/app/ota/res would otherwise yield the tail segment as the device id. Returns undefined on any shape this doesn't recognise, so an unparsed topic leaves deviceSn unset instead of carrying a guess.

Parameters

topic

string

Returns

ParsedTopic | 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.