Skip to content

Latest commit

 

History

History
55 lines (45 loc) · 1.3 KB

README.md

File metadata and controls

55 lines (45 loc) · 1.3 KB

💥 lightweight JavaScript interface for Hyperion

Install

npm version

npm install hyperion-js-api

Features

  • Control color and brightness of tv backlight.
  • Switch ambilight on/off. (optional)
  • Get current state/color

Basic Usage

const hyperion = new (require('hyperion-js-api'))("20.1.0.142",19444);
hyperion.setOn();
hyperion.getOn((error, response) => {
});
hyperion.setOff();
hyperion.setColor(hyperion.color.rgb(255, 0, 0));
hyperion.getColor((error, response) => {
});
hyperion.setBrightness(hyperion.color.value());
hyperion.getBrightness((error, response) => {
});
hyperion.setHue(hyperion.color.hue());
hyperion.getHue((error, response) => {
});
hyperion.setSaturation(hyperion.color.saturationv());
hyperion.getSaturation((error, response) => {
});

Tests

Find more examples in "test" directory.

Enter you hyperion server connection in package.json, and run some tests!

  "hyperion": {
    "host": "20.1.0.138",
    "port": "19444"
  }

run a single test from commandline with:

mocha test/hyperion.spec.js -g "setOff should switch off"

License

See the LICENSE file for license rights and limitations (MIT).