Skip to content

eufy-mega / model/capabilities / PtzPresetActions

Type Alias: PtzPresetActions

ts
type PtzPresetActions = object;

The preset sub-API — everything that acts on a stored PTZ preset, grouped under dev.ptz().preset(). The write verbs are always present; the read verbs (list/image) are request/reply over P2P and so present only when the device is bound to a live client — call them with ?..

The id-taking write verbs are fire-and-forget (P2P sends no ack): referencing an empty slot is a silent no-op — the camera ignores it and no error surfaces here. Only save(id) populates a slot; goto/preview/setDefault/delete on an unpopulated id do nothing. Check list?() first if the id might not exist.

Methods

delete()

ts
delete(id): Promise<void>;

Delete the stored preset id. No-op if id isn't a saved preset.

Parameters

id

number

Returns

Promise<void>


goto()

ts
goto(id): Promise<void>;

Move to the stored preset id. No-op if id isn't a saved preset (see the type note).

Parameters

id

number

Returns

Promise<void>


image()?

ts
optional image(id, opts?): Promise<PtzPresetImage | undefined>;

Fetch preset id's thumbnail. Present only when the device is bound to a live client, so call with ?.. Resolves undefined when the reply carried no image data — typically nothing stored for that preset. A reply that never arrives rejects instead.

Parameters

id

number

opts?
timeoutMs?

number

Returns

Promise<PtzPresetImage | undefined>


list()?

ts
optional list(opts?): Promise<PtzPreset[]>;

List the stored presets. Present only when the device is bound to a live client, so call with ?..

Parameters

opts?
timeoutMs?

number

Returns

Promise<PtzPreset[]>


preview()

ts
preview(id): Promise<void>;

Preview the stored preset id — move to it transiently (the app's pre-default preview). No-op if id isn't a saved preset.

Parameters

id

number

Returns

Promise<void>


save()

ts
save(id): Promise<void>;

Save the camera's current position into preset id (thumbnail + save). Creates the preset when the slot is empty, overwrites it when occupied.

Parameters

id

number

Returns

Promise<void>


setDefault()

ts
setDefault(id): Promise<void>;

Promote a preset to the default/home position. Sets the default to the preset the camera is currently parked on, so the sequence is preview(id) → wait for the pan to finish → setDefault(id); sent with the camera elsewhere it has no effect.

Parameters

id

number

Returns

Promise<void>

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.