Skip to content

@mega-yfue/eufy-sdk / 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. The readNum/readBool/readStr extractors in ./access.ts 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, Anker eufy, or eufy. "Anker eufy", "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.