{"version":3,"file":"SetEndColScalePos.mjs","names":[],"sources":["../../generated/api/SetEndColScalePos.ts"],"sourcesContent":["import { encodeUIntLE, ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetEndColScalePos(addr: number, bBroadcast: boolean, endColScalePos: number): Promise<void>;\n    trySetEndColScalePos(addr: number, endColScalePos: number): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetEndColScalePos<Broadcast extends boolean>(\n  addr: number,\n  bBroadcast: Broadcast,\n  endColScalePos: number\n): Request<Broadcast> {\n  const $data = encodeUIntLE(endColScalePos, AddressMapping.ColScaleParAOccupancy);\n  const req = new Request($data, bBroadcast, 'SetEndColScalePos');\n  req.destination = addr;\n  req.address = AddressMapping.EndColScalePosAddr;\n  return req;\n}\nSession.prototype.SetEndColScalePos = async function SetEndColScalePos(\n  this: Session,\n  addr: number,\n  bBroadcast: boolean,\n  endColScalePos: number\n): Promise<void> {\n  const req = createSetEndColScalePos(addr, bBroadcast, endColScalePos);\n  await this.connection.send(req);\n};\nSession.prototype.trySetEndColScalePos = async function trySetEndColScalePos(\n  this: Session,\n  addr: number,\n  endColScalePos: number\n): Promise<ErrorType | null> {\n  const req = createSetEndColScalePos(addr, false, endColScalePos);\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;AASA,SAAwB,wBACtB,MACA,YACA,gBACoB;CAEpB,MAAM,MAAM,IAAI,QADF,aAAa,iBACC,GAAG,YAAY,mBAAmB;CAC9D,IAAI,cAAc;CAClB,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,oBAAoB,eAAe,kBAEnD,MACA,YACA,gBACe;CACf,MAAM,MAAM,wBAAwB,MAAM,YAAY,cAAc;CACpE,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,QAAQ,UAAU,uBAAuB,eAAe,qBAEtD,MACA,gBAC2B;CAC3B,MAAM,MAAM,wBAAwB,MAAM,OAAO,cAAc;CAC/D,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}