{"version":3,"file":"SetLightTimePerSubFieldRatio.cjs","names":["Request"],"sources":["../../generated/api/SetLightTimePerSubFieldRatio.ts"],"sourcesContent":["import { encodeUIntLE, ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetLightTimePerSubFieldRatio(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      bBroadcast: boolean,\n      lightTimePerSubFieldRatio: number\n    ): Promise<void>;\n    trySetLightTimePerSubFieldRatio(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      lightTimePerSubFieldRatio: number\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetLightTimePerSubFieldRatio<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: Broadcast,\n  lightTimePerSubFieldRatio: number\n): Request<Broadcast> {\n  const $data = encodeUIntLE(\n    lightTimePerSubFieldRatio,\n    AddressMapping.LightTimePerSubFieldRatioOccupancy\n  );\n  const req = new Request($data, bBroadcast, 'SetLightTimePerSubFieldRatio');\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.LightTimePerSubFieldRatioAddr;\n  return req;\n}\nSession.prototype.SetLightTimePerSubFieldRatio = async function SetLightTimePerSubFieldRatio(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: boolean,\n  lightTimePerSubFieldRatio: number\n): Promise<void> {\n  const req = createSetLightTimePerSubFieldRatio(\n    addr,\n    portAddr,\n    scanBoardAddr,\n    bBroadcast,\n    lightTimePerSubFieldRatio\n  );\n  await this.connection.send(req);\n};\nSession.prototype.trySetLightTimePerSubFieldRatio = async function trySetLightTimePerSubFieldRatio(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  lightTimePerSubFieldRatio: number\n): Promise<ErrorType | null> {\n  const req = createSetLightTimePerSubFieldRatio(\n    addr,\n    portAddr,\n    scanBoardAddr,\n    false,\n    lightTimePerSubFieldRatio\n  );\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;;AAoBA,SAAwB,mCACtB,MACA,UACA,eACA,YACA,2BACoB;CAKpB,MAAM,MAAM,IAAIA,0DAHd,4BAG0B,GAAG,YAAY,8BAA8B;CACzE,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,+BAA+B,eAAe,6BAE9D,MACA,UACA,eACA,YACA,2BACe;CACf,MAAM,MAAM,mCACV,MACA,UACA,eACA,YACA,yBACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,wBAAQ,UAAU,kCAAkC,eAAe,gCAEjE,MACA,UACA,eACA,2BAC2B;CAC3B,MAAM,MAAM,mCACV,MACA,UACA,eACA,OACA,yBACF;CACA,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}