Skip to main content
Version: 6.5.1

Hardware

Some platforms support special hardware, that can be easily managed by JS using sOS hardware API.

LED

Some Philips brand devices have LED lights built into them. The color of lights can be changed or disabled:

All methods

MethodDescriptionSupported since
setColor()Method supports a string in hexa format to display color of LED light or null value to not be disabled1.0.1

setColor()

ParamTypeRequiredDescription
colorstring
Yes
Color of LED to be set in CSS hexa format #000000. To disable LED pass null value instead.

Javascript example

sos.hardware.led.setColor("#00FF00"); // For GREEN light

Errors

Although we are doing our best, following errors may occur when working with the hardware.

CodeTypeMessage
50601InternalHardwareErrorUnexpected error occurred when working with hardware.
40601AppletHardwareErrorColor must be string
40602AppletHardwareErrorColor must be in format #000000 or null, allowed are /^[a-zA-Z0-9\.\-_]+$/g