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?
optional accountName?: string;The logged-in account's display name (email local-part) — the lock cmd acting-username A4 field.
adminUserId?
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?
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
channel: number;Device channel (0 for standalone, device_channel on a HomeBase).
codec
codec: Codec;Resolved codec/family — lets a cross-family capability branch on transport.
deviceType?
optional deviceType?: number;eufy DeviceType, when known.
firmwareSubVersion?
optional firmwareSubVersion?: string;Secondary/sub firmware version — the record's sec_sw_version (app label firmware_sub_version).
firmwareVersion?
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?
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?
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?
optional macAddress?: string;Wi-Fi MAC address — the record's wifi_mac (app label mac_address).
model?
optional model?: string;Model / T-code, when known.
name?
optional name?: string;Display name, when known — sourced from the device record by the facade (for info).
paramIds
paramIds: ReadonlySet<number>;The param_type / DP ids this device has actually reported (evidence for variant selection).
serial?
optional serial?: string;Full device serial number, when known.
shortUserId?
optional shortUserId?: string;The acting member's short id (member.short_user_id, hex, e.g. "0003") — the lock cmd A5 field.
updateAvailable?
optional updateAvailable?: boolean;Firmware-update-available flag — the record's needUpdate.