Skip to content

eufy-mega / model/capabilities / CommandContext

Interface: CommandContext

Device context handed to CapabilityModule.buildCommand / CapabilityModule.actions so a capability can resolve the right command variant for THIS device — the same evidence detection keys on. Namespace-agnostic: paramIds holds security param ids OR vacuum Tuya DPs.

Properties

accountName?

ts
optional accountName?: string;

The logged-in account's display name (email local-part) — the lock cmd acting-username A4 field.


adminUserId?

ts
optional adminUserId?: string;

The lock owner's account id — the identity a lock command is authenticated against. Present on lock-family devices; absent elsewhere.


capabilities?

ts
optional capabilities?: ReadonlySet<Capability>;

The capability set the device was RESOLVED to have (from resolveDevice: curated row + codec baseline + per-module detection over the full, fresh record). buildCommand gates on this so the authorization matches exactly what device.has(cap) / buildActions saw — never a weaker re-detection from a partial context. Omit only in unit tests that pass evidence directly.


channel

ts
channel: number;

Device channel (0 for standalone, device_channel on a HomeBase).


codec

ts
codec: Codec;

Resolved codec/family — lets a cross-family capability branch on transport.


deviceType?

ts
optional deviceType?: number;

eufy DeviceType, when known.


firmwareSubVersion?

ts
optional firmwareSubVersion?: string;

Secondary/sub firmware version — the record's sec_sw_version (app label firmware_sub_version).


firmwareVersion?

ts
optional firmwareVersion?: string;

Firmware (main software) version — the device record's main_sw_version, the same field the v6 app maps to its firmware_main_version label. undefined when the record doesn't carry it.


hardwareVersion?

ts
optional hardwareVersion?: string;

Hardware version — the device record's main_hw_version (app label hardware_version). undefined when the record doesn't carry it.


hasP2p?

ts
optional hasP2p?: boolean;

Whether the device has a usable P2P endpoint (a non-empty p2p_did). A HomeBase-attached lock (T8531) is P2P-reachable; a standalone garage/lock (T85D0, p2p_did:"") is MQTT-only. The lock capability uses this to route lock/unlock to P2P vs. reject with a clear MQTT-not-wired error.


macAddress?

ts
optional macAddress?: string;

Wi-Fi MAC address — the record's wifi_mac (app label mac_address).


model?

ts
optional model?: string;

Model / T-code, when known.


name?

ts
optional name?: string;

Display name, when known — sourced from the device record by the facade (for info).


paramIds

ts
paramIds: ReadonlySet<number>;

The param_type / DP ids this device has actually reported (evidence for variant selection).


serial?

ts
optional serial?: string;

Full device serial number, when known.


shortUserId?

ts
optional shortUserId?: string;

The acting member's short id (member.short_user_id, hex, e.g. "0003") — the lock cmd A5 field.


updateAvailable?

ts
optional updateAvailable?: boolean;

Firmware-update-available flag — the record's needUpdate.

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.