Skip to content

@mega-yfue/eufy-sdk / RealtimeTransport

Interface: RealtimeTransport

Common surface for every realtime transport (smqtt / p2p). Implementations live under src/mqtt and src/p2p; the facade owns selection.

Properties

kind

ts
readonly kind: RealtimeKind;

Methods

connect()

ts
connect(): Promise<void>;

Returns

Promise<void>


disconnect()

ts
disconnect(): Promise<void>;

Returns

Promise<void>


on()

Call Signature

ts
on(event, listener): this;
Parameters
event

"connect"

listener

() => void

Returns

this

Call Signature

ts
on(event, listener): this;
Parameters
event

"disconnect"

listener

(reason?) => void

Returns

this

Call Signature

ts
on(event, listener): this;
Parameters
event

"message"

listener

(msg) => void

Returns

this

Call Signature

ts
on(event, listener): this;
Parameters
event

"error"

listener

(err) => void

Returns

this


publish()

ts
publish(
   topic, 
   body, 
   opts?
): Promise<void>;

Publish a command body to a device topic (the /req direction).

Parameters

topic

string

body

string | Buffer<ArrayBufferLike>

opts?
qos?

0 | 1 | 2

Returns

Promise<void>


subscribeDevice()

ts
subscribeDevice(device): Promise<void>;

Parameters

device

EufyDevice

Returns

Promise<void>

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.