0.0.903 • Published 1 year ago

otplc-linux-sys-class-leds v0.0.903

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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 ...

npm.io

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

npm.io