parsePtzPresets(xml: string): PtzPreset[]
Reads the saved presets from the reply to a cmd 190 request.
Presets without both an id and a name, which the camera lists for unused slots, are left out.
Read two presets
Read two presets
import { assertEquals } from "@std/assert"; import { parsePtzPresets } from "@hertzg/reolink-api/protocol/ptz"; const presets = parsePtzPresets( "<body><PtzPreset><presetList>" + "<preset><id>1</id><name>gate</name></preset>" + "<preset><id>2</id><name>porch</name></preset>" + "</presetList></PtzPreset></body>", ); assertEquals(presets, [{ id: 1, name: "gate" }, { id: 2, name: "porch" }]);
The saved presets, in reply order.