@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