variable support

Codec for <Support>.

Examples

Read the smart home assistants

import { assertEquals } from "@std/assert";
import { parse } from "@std/xml";
import { support } from "@hertzg/reolink-api/protocol/params";

const smartHome = parse(
  "<p><smartHome><version>1</version><item><name>googleHome</name>" +
    "<ver>2</ver></item></smartHome></p>",
).root;

assertEquals(support.fields.smartHome.decode("smartHome", smartHome), {
  version: 1,
  item: [{ name: "googleHome", ver: 2 }],
});

Type

XmlParam<"Support", Support>

Usage

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