{"version":3,"file":"SetColorAdjustEnable.cjs","names":["Request"],"sources":["../../generated/api/SetColorAdjustEnable.ts"],"sourcesContent":["import { ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetColorAdjustEnable(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      bBroadcast: boolean,\n      isEnable: boolean\n    ): Promise<void>;\n    trySetColorAdjustEnable(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      isEnable: boolean\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetColorAdjustEnable<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: Broadcast,\n  isEnable: boolean\n): Request<Broadcast> {\n  const req = new Request(isEnable ? [2] : [255], bBroadcast, 'SetColorAdjustEnable');\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.ColorAdjustEnableAddr;\n  return req;\n}\nSession.prototype.SetColorAdjustEnable = async function SetColorAdjustEnable(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: boolean,\n  isEnable: boolean\n): Promise<void> {\n  const req = createSetColorAdjustEnable(addr, portAddr, scanBoardAddr, bBroadcast, isEnable);\n  await this.connection.send(req);\n};\nSession.prototype.trySetColorAdjustEnable = async function trySetColorAdjustEnable(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  isEnable: boolean\n): Promise<ErrorType | null> {\n  const req = createSetColorAdjustEnable(addr, portAddr, scanBoardAddr, false, isEnable);\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;;AAoBA,SAAwB,2BACtB,MACA,UACA,eACA,YACA,UACoB;CACpB,MAAM,MAAM,IAAIA,wBAAQ,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,YAAY,sBAAsB;CAClF,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,UACe;CACf,MAAM,MAAM,2BAA2B,MAAM,UAAU,eAAe,YAAY,QAAQ;CAC1F,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,wBAAQ,UAAU,0BAA0B,eAAe,wBAEzD,MACA,UACA,eACA,UAC2B;CAC3B,MAAM,MAAM,2BAA2B,MAAM,UAAU,eAAe,OAAO,QAAQ;CACrF,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}