@mega-yfue/eufy-sdk / secureTopic
Function: secureTopic()
ts
function secureTopic(device, leg): string;Build a topic for a device: cmd/<prefix>/<model>/<sn>/<req|res>. leg is required — the two directions are one word apart and publishing to the wrong one fails silently. The prefix is derived by the module-local topicPrefix — eufy_home for clean-line devices, device.category elsewhere.
Parameters
device
leg
"req" | "res"
Returns
string