Skip to content

Commit

Permalink
getPressure: add Promise<> and undefined to types
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrippling committed Oct 30, 2023
1 parent 0c2f640 commit 448593b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libs/banglejs/jswrap_bangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -4904,7 +4904,7 @@ void jswrap_banglejs_ioWr(JsVarInt mask, bool on) {
"generate" : "jswrap_banglejs_getPressure",
"return" : ["JsVar","A promise that will be resolved with `{temperature, pressure, altitude}`"],
"#if" : "defined(DTNO1_F5) || defined(BANGLEJS_Q3) || defined(DICKENS)",
"typescript" : "getPressure(): PressureData;"
"typescript" : "getPressure(): Promise<PressureData> | undefined;"
}
Read temperature, pressure and altitude data. A promise is returned which will
be resolved with `{temperature, pressure, altitude}`.
Expand All @@ -4915,6 +4915,9 @@ conversions take between 500-750ms.
Altitude assumes a sea-level pressure of 1013.25 hPa
If there's no pressure device (for example, the emulator),
this returns undefined, rather than a promise.
```
Bangle.getPressure().then(d=>{
console.log(d);
Expand Down

0 comments on commit 448593b

Please sign in to comment.