mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 12:42:30 +04:00
* Update and fix JS docs This could really use some automation, atleast for API reference There are TypeScript definitions and typedocs, we don't need to be monkeys copying and reformatting this to API reference by hand * Fix bugged character * JS: Fix Number.toString() with decimals * Fix * Forgot this one * docs: mention per-view child format * Added @portasynthinca3 to docs' codeowners * Updated CODEOWNERS --------- Co-authored-by: Anna Antonenko <portasynthinca3@gmail.com> Co-authored-by: hedger <hedger@nanode.su> Co-authored-by: hedger <hedger@users.noreply.github.com>
53 lines
1.1 KiB
Markdown
53 lines
1.1 KiB
Markdown
# Flipper module {#js_flipper}
|
|
|
|
The module contains methods and values to query device information and properties. Call the `require` function to load the module before first using its methods:
|
|
|
|
```js
|
|
let flipper = require("flipper");
|
|
```
|
|
|
|
# Values
|
|
|
|
## firmwareVendor
|
|
String representing the firmware installed on the device.
|
|
Original firmware reports `"flipperdevices"`.
|
|
Do **NOT** use this to check the presence or absence of features, refer to [other ways to check SDK compatibility](#js_builtin_sdk_compatibility).
|
|
|
|
## jsSdkVersion
|
|
Version of the JavaScript SDK.
|
|
Do **NOT** use this to check the presence or absence of features, refer to [other ways to check SDK compatibility](#js_builtin_sdk_compatibility).
|
|
|
|
<br>
|
|
|
|
---
|
|
|
|
# Methods
|
|
|
|
## getModel()
|
|
Returns the device model.
|
|
|
|
**Example**
|
|
```js
|
|
flipper.getModel(); // "Flipper Zero"
|
|
```
|
|
|
|
<br>
|
|
|
|
## getName()
|
|
Returns the name of the virtual dolphin.
|
|
|
|
**Example**
|
|
```js
|
|
flipper.getName(); // "Fur1pp44"
|
|
```
|
|
|
|
<br>
|
|
|
|
## getBatteryCharge()
|
|
Returns the battery charge percentage.
|
|
|
|
**Example**
|
|
```js
|
|
flipper.getBatteryCharge(); // 100
|
|
```
|