@mega-yfue/eufy-sdk / LightActions
Type Alias: LightActions
type LightActions = Surface<typeof LIGHT_MEMBERS> & object;Bound spotlight / floodlight controls — the object returned by dev.light().
The reads and their setters are DERIVED from LIGHT_MEMBERS: one declaration per feature gives the getter, the setter, its argument type and its description. Only what a member table cannot state is written out below.
Type Declaration
off()
off(): Promise<void>;Turn the light off. Throws if this model's switch wire is unverified.
Returns
Promise<void>
on()
on(): Promise<void>;Turn the light on. Throws if this model's switch wire is unverified.
Returns
Promise<void>
setAutoSpotlight()
setAutoSpotlight(on, opts?): Promise<void>;Enable/disable the motion-activated light (auto-spotlight): the spotlight lights up when the camera detects motion.
⚠️ This is a COMPOSITE write, and it is WRITE-ONLY: the setting is not reported back in the device's params, so the current config cannot be read and merged. Calling it with just on re-sends the DEFAULT brightness/auto-off/mode (AutoSpotlightOptions), overwriting whatever the user set. To preserve their config, pass the current values in opts. That is why this is a method and not a member — the caller must own the composite.
Parameters
on
boolean
opts?
Returns
Promise<void>