Skip to content

eufy-mega / client/eufy-mega / EufyMegaEventMap

Type Alias: EufyMegaEventMap

ts
type EufyMegaEventMap = { [K in keyof DeviceEventMap]: [DeviceEventMap[K]] } & object;

The complete typed event surface of EufyMega — event name → listener-argument tuple.

Two groups:

  • Semantic events (motion, doorbellPress, lockState, ptzNotify, …) — projected from the capability modules via DeviceEventMap, so adding a capability event adds a typed event here automatically (one line in that map).
  • Low-level / lifecycle events — the raw escape hatches and transport lifecycle.

Type Declaration

commandAck

ts
commandAck: [object];

A transport-level command got a delivery ack (or didn't) — emitted by the MQTT command router. For ff09-actuate the reply is a "device received it" signal, not a physical-actuation-complete one (see that handler's doc); for ff09-autolock the GET step already threw on no reply by the time this fires — getAcked is always true here, acked reports the SET step's fire-and-forget ack. dispatch()/lock()/unlock()/setAutoLock() stay Promise<void> and never throw on a missing SET ack (fire-and-forget, same as every other write) — this event is the optional channel for a host that wants delivery visibility without the dispatch contract itself changing shape.

connect

ts
connect: [];

deviceAdded

ts
deviceAdded: [EufyDevice];

A device appeared on the account since the previous poll — a pairing, or a device that became visible again. Account topology, so it lives here rather than on the per-device capability map.

Fires only for a device the SDK has seen the account WITHOUT; the first enumeration after login is not a stream of additions. Suppressed when the baseline it would be measured against only partly resolved, so a recovering outage doesn't read as a burst of pairings.

deviceCapabilities

ts
deviceCapabilities: [object];

A device a caller is holding gained capabilities, because it reported evidence it hadn't before. gained is what is newly available; capabilities is the full set after widening.

A Device resolves its capabilities from the evidence available at the time, so one resolved before the device had reported a param lacks the capability that param proves. When a later poll supplies it, the object is re-resolved and re-bound in place — the new accessor is live on the instance the host already has. Capabilities are never retracted, so this only ever widens.

deviceRemoved

ts
deviceRemoved: [EufyDevice];

A device is gone from the account — unpaired, or moved away.

Deliberately conservative: suppressed when a poll only partially resolved (a failed house query returns a subset), because a host acting on this typically deletes an accessory, and an absence caused by an outage is not a removal.

deviceState

ts
deviceState: [DeviceState];

A device reported to the cloud since the last poll — its DeviceState.lastSeenMs advanced. Carries DeviceState; the host applies its own staleness threshold.

Transport/session lifecycle is NOT this event: that's p2pConnect/p2pClose, station-scoped where a session actually lives.

disconnect

ts
disconnect: [unknown];

error

ts
error: [Error];

event

ts
event: [AnyDeviceEvent];

Catch-all: fires for EVERY semantic event, payload tagged with its eventName.

message

ts
message: [RealtimeMessage];

p2p

ts
p2p: [P2PFrame];

p2pClose

ts
p2pClose: [string];

p2pConnect

ts
p2pConnect: [string];

p2pLevel2Ready

ts
p2pLevel2Ready: [object];

push

ts
push: [PushEvent];

pushConnect

ts
pushConnect: [];

pushDisconnect

ts
pushDisconnect: [];

pushRaw

ts
pushRaw: [RawPushMessage];

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations or eufy. "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.