Skip to content

eufy-mega / model/capabilities / CapabilityStateReader

Type Alias: CapabilityStateReader

ts
type CapabilityStateReader = (name) => PropertyValue | undefined;

Live-state accessor handed to CapabilityModule.actions so a capability can expose typed read getters on its fluent object (dev.battery()?.level: number) alongside its write methods — closing the read/write asymmetry (writes are typed+fluent; a raw getProperty("battery")?.value is the loose ParamValue). Returns the current property value for a property NAME, or undefined if never observed. The facade wires it to the device's live state, so a getter built once stays current as realtime/poll updates land. Extract the value with the reads.ts helpers (readNum/readBool/readStr) — they guard the runtime type rather than lie-cast.

Parameters

name

string

Returns

PropertyValue | undefined

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.