eufy-mega / model/capabilities / ReadSpec
Interface: ReadSpec
One typed read getter a capability exposes on its fluent dev.<cap>() object — accessor is the getter name ("level"), property is the property-schema name it reads ("battery"). The getter's value type is derived from that spec's type (bool → boolean, number/enum → number, string → string). The barrel builds these evidence-gated: a getter is installed only when the device actually reported the backing param (see buildReads), so a device advertises only the reads it truly has — never a phantom sub-feature of the capability it happens to own.
Properties
accessor
accessor: string;property
property: string;realtime?
optional realtime?: boolean;Install this getter whenever the capability is present, instead of only once the device has been seen reporting the backing param.
For a line whose state arrives ONLY over realtime, prior observation is the wrong evidence: there is no cloud param to gate on, and gating on "has reported already" makes the read surface depend on whether the device happened to report before it was resolved — permanently, since the getters are built once at bind time. The capability's own detection is the evidence that the device reports these fields; the getter reads undefined until the first report lands, which is what an optional getter already means.
This does NOT weaken the never-ship-a-guessed-param rule — the field must still be verified on real hardware to be declared at all.