node-atbrightness

3.0.1 • Public • Published

node-atbrightness

Node.js Integration for Advantech IIoT brightness function.

Notice that an Advantech IIoT Platform SDK have to be installed to make this node works correctly. Advantech IIoT Platform SDK download link is shown below:

Windows: https://github.com/Advantech-IIoT/Platform-SDK/tree/master/windows/bin

Linux: https://github.com/Advantech-IIoT/Platform-SDK/tree/master/linux/bin

Install

Use npm command to install this package locally in the Node-RED modules directory

npm install node-atbrightness

or install it globally with the command

npm install node-atbrightness -g

Usage

Brightness provide four functions in this module.

  • Get Brightness Values (Maximum, Minimum, and Current Values)
  • Set Brightness Values (Maximum, Minimum, and Current Values)
  • Check Auto Brightness Status
  • Set Auto Brightness

Example

Please refer demo.js.

All these examples are started with:

var brightness = require('node-atbrightness');

Get Brightness Values

This sample prints the all of the brightness status.

// Get the Minimum Brightness Value
console.log(brightness.getbrightnessmin());

// Get the Maximum Brightness Value
console.log(brightness.getbrightnessmax());

// Get the Current Brightness Value
console.log(brightness.getbrightnessvalue());

Set Brightness Values

If the value you input is not between brightness.getbrightnessmin() and brightness.getbrightnessmax(), it will output a number--50.

console.log(brightness.setbrightnessvalue(5));

Check Auto Brightness Status

Output value:

  • 0: Set Brightness Manually
  • 1: Set Brightness Automatically
  • 50: Not Support
console.log(brightness.checkautobrightness());

Set Auto Brightness

Return value:

  • 0: Set Brightness Manually
  • 1: Set Brightness Automatically
  • 50: Not Support
// Auto Brightness
console.log(brightness.setautobrightness(true));

// Manually Brightness
console.log(brightness.setautobrightness(false));

Test Platform

  • Windows 10 Enterprise LTSC with node.js 18.14.1

History

  • 3.0.1 - June 2023 : update for NODE_MODULE_VERSION=108 (C++ addons use Node-API)
  • 1.0.0 - November 2019 : update for NODE_MODULE_VERSION=64 (C++ addons use Native Abstractions for Node.js)
  • 0.1.7 - October 2017 : Initial Release

License

Copyright 2023 ADVANTECH Corp. under the Apache 2.0 license.

Package Sidebar

Install

npm i node-atbrightness

Weekly Downloads

0

Version

3.0.1

License

Apache-2.0

Unpacked Size

212 kB

Total Files

7

Last publish

Collaborators

  • advantech-iiot