eufy-mega / model/capabilities / LockActions
Type Alias: LockActions
type LockActions = object;Bound lock controls — the object returned by dev.lock().
lock / unlock drive any lock-family actuator — currently the T8531 video smart lock and the T85D0 garage door, which share one actuation frame. This module emits ONE transport-neutral intent (identity fields only, no wire bytes, no cipher, no routing key) and names no transport: the command sink routes P2P vs MQTT by the device's topology, and the chosen transport's command router builds the frame + envelope and re-resolves its own routing tail. The host never needs to know which pipe it is — dev.lock() looks identical either way, the same way P2P-vs-cloud is hidden for live media.
Properties
battery?
readonly optional battery?: number;Lock battery level 0-100 (property battery).
locked?
readonly optional locked?: boolean;Lock state, true = locked (property locked). UNVERIFIED state param — may be absent.
rssi?
readonly optional rssi?: number;Lock signal strength in dBm (property rssi).
Methods
getAutoLockState()
getAutoLockState(): Promise<LockAutoLockSnapshot>;Read the device's current auto-lock settings via a live GET_SETTINGS round-trip — the SAME read setAutoLock already does internally to preserve fields it isn't changing, exposed standalone with no write attached. Works over BOTH transports. Rejects if unbound (no live client) or missing member identity, same failure modes as the other actions — this is a genuine request/reply query, not a passive property, so it always talks to the device rather than returning cached state.
Returns
Promise<LockAutoLockSnapshot>
lock()
lock(): Promise<void>;Lock the deadbolt/door. Fire-and-forget — rejects only on missing member identity, never on a device timeout.
Returns
Promise<void>
setAutoLock()
setAutoLock(enabled, delaySeconds?): Promise<void>;Read-modify-write the auto-lock setting: GETs the device's current settings, changes only enabled (+ delaySeconds if given — otherwise the current delay is preserved), and writes back the rest of the fields verbatim as read (a few are unconfirmed and echoed back unchanged). Works on both the T8531 video lock and the T85D0 garage/lock, which share the identical settings frame. Confirmed on-device in both directions on both families, with the app UI reflecting the new state afterward.
Unlike lock/unlock, this can reject on a device timeout (not just missing identity) — the GET step is a genuine precondition (the current delay/A7/A8 must be read before they can be preserved), so a caller relying on every LockActions method being fire-and-forget should still .catch() this one.
Parameters
enabled
boolean
delaySeconds?
number
Returns
Promise<void>
setLogEnabled()?
optional setLogEnabled(enabled): Promise<void>;ABSENT until captured — same reasoning as setOneTouchLock (setting-id 6).
Parameters
enabled
boolean
Returns
Promise<void>
setOneTouchLock()?
optional setOneTouchLock(enabled): Promise<void>;ABSENT until the wire is confirmed. It has the same compact-write shape as setRainMode, and that shape is grounded in the app's own behaviour — but unlike setRainMode, this specific write has NOT been independently confirmed against a real device. Source-grounding alone doesn't clear this codebase's ship bar (same as siren): a fire-and-forget write that's wrong looks exactly like success. Per the type-level honesty rule, an unverified write is NOT installed on the fluent object (a present method means its wire is verified) — so this getter is undefined on every device today, and a host sees at compile time that it isn't settable yet. Trivial to promote: flip its liveVerified flag once captured (see settingToggle's doc). Even once promoted it stays optional — P2P video lock (T8531) only, same reasoning as setRainMode.
Parameters
enabled
boolean
Returns
Promise<void>
setOneTouchRearLock()?
optional setOneTouchRearLock(enabled): Promise<void>;ABSENT until captured — same reasoning as setOneTouchLock (setting-id 11).
Parameters
enabled
boolean
Returns
Promise<void>
setPrivacyMode()?
optional setPrivacyMode(enabled): Promise<void>;ABSENT until captured — same reasoning as setOneTouchLock (setting-id 9).
Parameters
enabled
boolean
Returns
Promise<void>
setRainMode()?
optional setRainMode(enabled): Promise<void>;Toggle Rain Mode. A pure blind write, unlike setAutoLock — the compact frame carries only this one field, so there is no GET pass first, and unlike setAutoLock this is fire-and-forget: it rejects only on missing member identity, same as lock/unlock, never on a device timeout. Confirmed on-device end-to-end in both directions, with the app UI reflecting the new state afterward. Optional: only known to exist on the T8531 video lock — the garage door (T85D0, MQTT) doesn't expose this in the app UI, so it's offered only on P2P-reachable devices (gated on the hasP2p topology fact) rather than guessing a wire shape that likely doesn't exist.
Parameters
enabled
boolean
Returns
Promise<void>
setScramblePasscode()?
optional setScramblePasscode(enabled): Promise<void>;ABSENT until captured — same reasoning as setOneTouchLock (setting-id 3).
Parameters
enabled
boolean
Returns
Promise<void>
setWifiStatus()?
optional setWifiStatus(enabled): Promise<void>;ABSENT until captured — same reasoning as setOneTouchLock (setting-id 5).
Parameters
enabled
boolean
Returns
Promise<void>
unlock()
unlock(): Promise<void>;Unlock the deadbolt/door. Fire-and-forget — rejects only on missing member identity, never on a device timeout.
Returns
Promise<void>