{"version":3,"file":"SetDehumidAdjustTime.cjs","names":["Request"],"sources":["../../generated/api/SetDehumidAdjustTime.ts"],"sourcesContent":["import { ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetDehumidAdjustTime(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      bBroadcast: boolean,\n      data: number[] | Buffer\n    ): Promise<void>;\n    trySetDehumidAdjustTime(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      data: number[] | Buffer\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetDehumidAdjustTime<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: Broadcast,\n  data: number[] | Buffer\n): Request<Broadcast> {\n  if (data.length !== AddressMapping.DehumidAdjustTimeOccupancy)\n    throw new TypeError(`Invalid buffer size: ${data.length}`);\n  const req = new Request(data, bBroadcast, 'SetDehumidAdjustTime');\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.DehumidAdjustTimeAddr;\n  return req;\n}\nSession.prototype.SetDehumidAdjustTime = async function SetDehumidAdjustTime(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: boolean,\n  data: number[] | Buffer\n): Promise<void> {\n  const req = createSetDehumidAdjustTime(addr, portAddr, scanBoardAddr, bBroadcast, data);\n  await this.connection.send(req);\n};\nSession.prototype.trySetDehumidAdjustTime = async function trySetDehumidAdjustTime(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  data: number[] | Buffer\n): Promise<ErrorType | null> {\n  const req = createSetDehumidAdjustTime(addr, portAddr, scanBoardAddr, false, data);\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;;AAoBA,SAAwB,2BACtB,MACA,UACA,eACA,YACA,MACoB;CACpB,IAAI,KAAK,cACP,MAAM,IAAI,UAAU,wBAAwB,KAAK,QAAQ;CAC3D,MAAM,MAAM,IAAIA,wBAAQ,MAAM,YAAY,sBAAsB;CAChE,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,uBAAuB,eAAe,qBAEtD,MACA,UACA,eACA,YACA,MACe;CACf,MAAM,MAAM,2BAA2B,MAAM,UAAU,eAAe,YAAY,IAAI;CACtF,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,wBAAQ,UAAU,0BAA0B,eAAe,wBAEzD,MACA,UACA,eACA,MAC2B;CAC3B,MAAM,MAAM,2BAA2B,MAAM,UAAU,eAAe,OAAO,IAAI;CACjF,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}