otplc-linux-sys-class-leds

0.0.903 • Public • Published

otplc-linux-sys-class-leds

    Is to have a nodejs interface for leds on your keyboard.

Can not only on/off also get/set values and triggers.

use case

Video showing how to set it up and use it wrapt in node-red node as node-red-otplc-linux-sys-class-leds ...

node-red-otplc-linux-sys-class-leds oiyshTerminal at npm - on youtube from

requirements

  • linux

  • access to write and read files on your system /sys/class/leds/*/brightness and/or

    /sys/class/leds/*/trigger

installation using npm

Install it locally or with -g globally

npm i otplc-linux-sys-class-leds

then check it in node ...

how to use it example

In node command line:

> let o0 = require("otplc-linux-sys-class-leds");
undefined
> let l = new o0();
undefined
> l.dirList();
[ 'input2::capslock', 'input2::numlock', 'input2::scrolllock' ]
> l.chkperm('input2::capslock');
true
> l.getStatusFromSysFs('input2::capslock');
{
  name: 'input2::capslock',
  brightness: {
    now: 0,
    max: 1,
    trigger: 'kbd-capslock',
    triggers: [
      'none',
      .....
      'kbd-ctrlrlock',
      'AC-online',
      'rc-feedback'
    ]
  }
}
> l.getStatus('input2::capslock');
0
> l.set('input2::capslock','1');
OK
undefined
> l.getStatus('input2::capslock');
1

If you see that this make sens

Package Sidebar

Install

npm i otplc-linux-sys-class-leds

Weekly Downloads

2

Version

0.0.903

License

ISC

Unpacked Size

9.49 kB

Total Files

5

Last publish

Collaborators

  • yoyoek1