{"version":3,"file":"SetScaleEn.cjs","names":["Request"],"sources":["../../generated/api/SetScaleEn.ts"],"sourcesContent":["import { ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetScaleEn(addr: number, bBroadcast: boolean, isEnableScale: boolean): Promise<void>;\n    trySetScaleEn(addr: number, isEnableScale: boolean): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetScaleEn<Broadcast extends boolean>(\n  addr: number,\n  bBroadcast: Broadcast,\n  isEnableScale: boolean\n): Request<Broadcast> {\n  const req = new Request(isEnableScale ? [88] : [255], bBroadcast, 'SetScaleEn');\n  req.destination = addr;\n  req.address = AddressMapping.DVIScaleEnAddr;\n  return req;\n}\nSession.prototype.SetScaleEn = async function SetScaleEn(\n  this: Session,\n  addr: number,\n  bBroadcast: boolean,\n  isEnableScale: boolean\n): Promise<void> {\n  const req = createSetScaleEn(addr, bBroadcast, isEnableScale);\n  await this.connection.send(req);\n};\nSession.prototype.trySetScaleEn = async function trySetScaleEn(\n  this: Session,\n  addr: number,\n  isEnableScale: boolean\n): Promise<ErrorType | null> {\n  const req = createSetScaleEn(addr, false, isEnableScale);\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;;AASA,SAAwB,iBACtB,MACA,YACA,eACoB;CACpB,MAAM,MAAM,IAAIA,wBAAQ,gBAAgB,CAAC,EAAE,IAAI,CAAC,GAAG,GAAG,YAAY,YAAY;CAC9E,IAAI,cAAc;CAClB,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,aAAa,eAAe,WAE5C,MACA,YACA,eACe;CACf,MAAM,MAAM,iBAAiB,MAAM,YAAY,aAAa;CAC5D,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,wBAAQ,UAAU,gBAAgB,eAAe,cAE/C,MACA,eAC2B;CAC3B,MAAM,MAAM,iBAAiB,MAAM,OAAO,aAAa;CACvD,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}