/hyperion-ng-api

Hyperion NG Api

Primary LanguageJavaScriptMIT LicenseMIT

Hyperion NG Api

#WARNING: PACKAGE IS NOT SUPPORTED ANYMORE.

This is an early version. Still to do a lot. Testing, documentation and implementing more functionality.

Installation

npm version

$ npm install --save hyperion-ng-api

Usage

const HyperionNg = require('hyperion-ng-api');

//Host, Port, WsTan, Priority (Use 1 if you want to overwrite WebUI priority. Remember WebUI is always priority 1.)
hyperion = new HyperionNg('192.168.178.23', 19444, 666, 1);

hyperion.getServerInfo(function (err, data){
  (err) ? console.log(err) : console.log(data);
})

Changelog

0.0.4 (2018-06-07): Added functions "getStartupEffect" and "playStatupEffect"

0.0.3 (2018-06-01): Added more documentation. Deleted a duplicated function

0.0.2 (2018-06-01): Small file changes

0.0.1 (2018-06-01): First Version

Table of Contents

disableHyperion

disableHyperion: Disables all activated components. The Ng-Way to switch off.

Parameters

Returns Function callback return string from hyperion.ng

enableHyperion

enableHyperion: Enables all previous activated components. The Ng-Way to switch on.

Parameters

Returns Function callback return string from hyperion.ng

disableLedDevice

disableLedDevice: Disables the LED Device. You can see this as "send color black"

Parameters

Returns Function callback return string from hyperion.ng

enableLedDevice

enableLedDevice: Activates the LED Device.

Parameters

Returns Function callback return string from hyperion.ng

getServerInfo

getServerInfo: Get the server info JSON. All information you need from hyperion. There are more functions available to wrap this. Eg: getAllEffects

Parameters

Returns Function callback return string from hyperion.ng

getAllComponents

getAllComponents: Get all components. Wrap function for getServerInfo

Parameters

Returns Function callback return string from hyperion.ng

getAllEffects

getAllEffects: Get all effects. Wrap function for getServerInfo

Parameters

Returns Function callback return string from hyperion.ng

getStartupEffect

getStartupEffect: Gets the effect which is used for startup

Parameters

Returns Function callback return string from hyperion.ng

getAllGrabbers

getAllGrabbers: Get all Grabbers. Wrap function for getServerInfo

Parameters

Returns Function callback return string from hyperion.ng

getAllLedDevices

getAllLedDevices: Get all led devices. Wrap function for getServerInfo

Parameters

Returns Function callback return string from hyperion.ng

getLedMappingType

getLedMappingType: Get the current led mapping type. Wrap function for getServerInfo

Parameters

Returns Function callback return string from hyperion.ng

getAllPriorities

getAllPriorities: Get all priorities. Wrap function for getServerInfo

Parameters

Returns Function callback return string from hyperion.ng

getSysInfo

getSysInfo: Get system information about the operating system of hyperion.ng instance

Parameters

Returns Function callback return string from hyperion.ng

getServerConfig

getServerConfig: Gets the current config file

Parameters

Returns Function callback return string from hyperion.ng

getServerConfigSchema

getServerConfigSchema: Gets the current config schema

Parameters

Returns Function callback return string from hyperion.ng

setMappingTypeMulticolor

setMappingTypeMulticolor: Set the Led Mapping Type to multicolor (classic atmolight)

Parameters

Returns Function callback return string from hyperion.ng

setMappingTypeUnicolor

setMappingTypeMulticolor: Set the Led Mapping Type to unicolor (one color calculated and send to ALL leds)

Parameters

Returns Function callback return string from hyperion.ng

setMappingType

setMappingType: Set the Led Mapping type. Currently 'unicolor_mean' and 'multicolor_mean' is supported. Inserting something other will likely result in an error

Parameters

  • type string for now only use 'unicolor_mean' or 'multicolor_mean'
  • callback Function

Returns Function callback return string from hyperion.ng

setComponentState

setComponentState: Sets a component to true or false

Parameters

  • comp string The component. You can use getAllComponents to get the names.
  • state boolean true or false
  • callback Function

Returns Function callback return string from hyperion.ng

setColor

setColor: Sets the color for a given priority and duration

Parameters

Returns Function callback return string from hyperion.ng

setColorToBlackPermanently

setColorToBlackPermanently: Sets the color to black with duration 0

Parameters

Returns Function callback return string from hyperion.ng

setEffect

setEffect: Sets an effect.

Parameters

  • effectName string You can use getAllEffects to get the name
  • duration number in seconds. Use 0 for infinite
  • callback Function

Returns Function callback return string from hyperion.ng

setBrightness

setBrightness: Set the led brightness

Parameters

Returns Function callback return string from hyperion.ng

setSourceToAutoSelection

setSourceToAutoSelection: Activates autoselection

Parameters

Returns Function callback return string from hyperion.ng

setSource

setSource: set a source (priority) to active

Parameters

  • priority number You can use getAllPriorities to get the id
  • callback Function

Returns Function callback return string from hyperion.ng

clearPriority

clearPriority: clears the given priority

Parameters

  • priority number You can use getAllPriorities to get the id
  • callback Function

Returns Function callback return string from hyperion.ng

clearApiPriority

clearApiPriority: clears the priority which is used by this api

Parameters

Returns Function callback return string from hyperion.ng

clearAllPriority

clearAllPriority: clears all priority

Parameters

Returns Function callback return string from hyperion.ng

playStatupEffect

playStatupEffect: plays the startup effect with configured time

Parameters

Returns Function callback return string from hyperion.ng

sendToHyperion

sendToHyperion: Main function to communicate with hyperion.ng. This function is calles by the other functions. If you know the commands you want to call on hyperion side you can call this function directly.

Parameters

Returns Function callback return string from hyperion.ng