Skip to content

Commit

Permalink
Merge pull request #2422 from bobrippling/getpressure-ts
Browse files Browse the repository at this point in the history
getPressure: add Promise<> and undefined to types
  • Loading branch information
gfwilliams authored Nov 1, 2023
2 parents 0c2f640 + 448593b commit e4308c2
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 e4308c2

Please sign in to comment.