variable COMMANDS

The firmware request commands, for Client.call.

Examples

Find a command by the id seen on the wire

import { assertEquals } from "@std/assert";
import { COMMANDS } from "@hertzg/reolink-api/protocol/commands";

const found = Object.values(COMMANDS).find((candidate) => candidate.id === 93);

assertEquals(found?.name, "GET_LINK_TYPE");

List the commands only the doorbell registers

import { assertEquals } from "@std/assert";
import { COMMANDS } from "@hertzg/reolink-api/protocol/commands";

const doorbellOnly = Object.values(COMMANDS).filter((candidate) =>
  !candidate.firmware.includes("RLC-823A")
);

assertEquals(doorbellOnly.some((candidate) => candidate.name === "DINGDONG_CTRL"), true);

Type

Usage

import { COMMANDS } from "protocol/commands.ts";