variable shelter

Codec for <Shelter>.

Examples

Build a <Shelter> element for cmd 53 that clears mask 2

import { assertStringIncludes } from "@std/assert";
import { shelter } from "@hertzg/reolink-api/protocol/params";

const xml = shelter.encode({
  channelId: 0,
  shelterList: [{ id: 2, enable: 0 }],
});

assertStringIncludes(
  xml,
  "<shelterList><Shelter><id>2</id><enable>0</enable></Shelter></shelterList>",
);

Type

XmlParam<"Shelter", Shelter>

Usage

import { shelter } from "protocol/params/mod.ts";