{"version":3,"file":"ReadDoorSwitchDetection.mjs","names":[],"sources":["../../generated/api/ReadDoorSwitchDetection.ts"],"sourcesContent":["import { decodeUIntLE, Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadDoorSwitchDetection(addr: number): Promise<number>;\n    tryReadDoorSwitchDetection(addr: number): Promise<Packet | null>;\n  }\n}\nexport default function createReadDoorSwitchDetection(addr: number): Request {\n  const req = new Request(AddressMapping.DoorSwitchDetectionOccupancy, 'ReadDoorSwitchDetection');\n  req.destination = addr;\n  req.address = AddressMapping.DoorSwitchDetectionAddr;\n  return req;\n}\nSession.prototype.ReadDoorSwitchDetection = async function ReadDoorSwitchDetection(\n  this: Session,\n  addr: number\n): Promise<number> {\n  const req = createReadDoorSwitchDetection(addr);\n  return decodeUIntLE(await this.connection.send(req));\n};\nSession.prototype.tryReadDoorSwitchDetection = async function tryReadDoorSwitchDetection(\n  this: Session,\n  addr: number\n): Promise<Packet | null> {\n  const req = createReadDoorSwitchDetection(addr);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;AASA,SAAwB,8BAA8B,MAAuB;CAC3E,MAAM,MAAM,IAAI,WAAqD,yBAAyB;CAC9F,IAAI,cAAc;CAClB,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,0BAA0B,eAAe,wBAEzD,MACiB;CACjB,MAAM,MAAM,8BAA8B,IAAI;CAC9C,OAAO,aAAa,MAAM,KAAK,WAAW,KAAK,GAAG,CAAC;AACrD;AACA,QAAQ,UAAU,6BAA6B,eAAe,2BAE5D,MACwB;CACxB,MAAM,MAAM,8BAA8B,IAAI;CAC9C,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}