Codec for <DeviceInfo>.
Round-trip a doorbell reply
Round-trip a doorbell reply
import { assertEquals } from "@std/assert"; import { parse } from "@std/xml"; import { deviceInfo } from "@hertzg/reolink-api/protocol/params"; const value = { firmVersion: "firm-doorbell", IOInputPortNum: 0, IOOutputPortNum: 0, diskNum: 1, type: "smart_bell" as const, channelNum: 1, audioNum: 1, ipChannel: 0, analogChnNum: 1, resolution: { resolutionName: "2560*1920", width: 2560, height: 1920 }, secretCode: "secret-doorbell", bootSecret: "secret-doorbell", language: "English", sdCard: 1, ptzMode: "none" as const, typeInfo: "type-doorbell", softVer: 1, hardVer: 2, panelVer: 3, hdChannel1: 0, hdChannel2: 0, hdChannel3: 0, hdChannel4: 0, norm: "NTSC" as const, osdFormat: "MDY", B485: 0, supportAutoUpdate: 1, userVer: 1, FrameworkVer: 1, authMode: 0, sleep: 0, feature: 2, }; assertEquals(deviceInfo.decode(parse(deviceInfo.encode(value)).root), value);
XmlParam<"DeviceInfo", DeviceInfo>