Brightness

This API provides a simple way to interact with the brightness of your device.

Usage
Brightness.setBrightness(0.7);

...

Brightness.getBrightness().then(val=>console.log(val));

...

Brightness.setKeepScreenOn(true);
window.Brightness.setBrightness(0.7);

...

window.Brightness.getBrightness().then((val) => console.log(val));

...

window.Brightness.setKeepScreenOn(true);
window.Brightness.setBrightness(0.7);

...

window.Brightness.getBrightness().then((val) => console.log(val));

...

window.Brightness.setKeepScreenOn(true);
(<any>window).Brightness.setBrightness(0.7);

...

(<any>window).Brightness.getBrightness().then((val) => console.log(val));

...

(<any>window).Brightness.setKeepScreenOn(true);
window.Brightness.setBrightness(0.7);

...

window.Brightness.getBrightness().then((val) => console.log(val));

...

window.Brightness.setKeepScreenOn(true);

Classes


Brightness

setBrightness
setBrightness(option: float): Promise<any>

Set the device brightness


PARAMETERS
option: float 0-1 is a brightness level where 0 represents the min brightness level, 1 represents the highest level and -1 a system default.

RETURN
returns: Promise <any>
getBrightness
getBrightness(): Promise<number>

Get the device current brightness


RETURN
returns: Promise <number>
setKeepScreenOn
setKeepScreenOn(option: boolean): Promise<any>

Prevents the device from sleeping


PARAMETERS
option: boolean

RETURN
returns: Promise <any>