1
mirror of https://github.com/flipperdevices/flipperzero-firmware.git synced 2025-12-12 04:41:26 +04:00
Files
flipperzero-firmware/documentation/js/js_flipper.md
WillyJL d34ff3310d JS: Update and fix docs, fix Number.toString() with decimals (#4168)
* 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>
2025-04-01 15:02:12 +04:00

1.1 KiB

Flipper module

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:

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.

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.



Methods

getModel()

Returns the device model.

Example

flipper.getModel(); // "Flipper Zero"

getName()

Returns the name of the virtual dolphin.

Example

flipper.getName(); // "Fur1pp44"

getBatteryCharge()

Returns the battery charge percentage.

Example

flipper.getBatteryCharge(); // 100