hyperion-ng-api v0.0.4
Hyperion NG Api
This is an early version. Still to do a lot. Testing, documentation and implementing more functionality.
Installation
$ 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
- enableHyperion
- disableLedDevice
- enableLedDevice
- getServerInfo
- getAllComponents
- getAllEffects
- getStartupEffect
- getAllGrabbers
- getAllLedDevices
- getLedMappingType
- getAllPriorities
- getSysInfo
- getServerConfig
- getServerConfigSchema
- setMappingTypeMulticolor
- setMappingTypeUnicolor
- setMappingType
- setComponentState
- setColor
- setColorToBlackPermanently
- setEffect
- setBrightness
- setSourceToAutoSelection
- setSource
- clearPriority
- clearApiPriority
- clearAllPriority
- playStatupEffect
- sendToHyperion
disableHyperion
disableHyperion: Disables all activated components. The Ng-Way to switch off.
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
enableHyperion
enableHyperion: Enables all previous activated components. The Ng-Way to switch on.
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
disableLedDevice
disableLedDevice: Disables the LED Device. You can see this as "send color black"
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
enableLedDevice
enableLedDevice: Activates the LED Device.
Parameters
callback
Function
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
callback
Function
Returns Function callback return string from hyperion.ng
getAllComponents
getAllComponents: Get all components. Wrap function for getServerInfo
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
getAllEffects
getAllEffects: Get all effects. Wrap function for getServerInfo
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
getStartupEffect
getStartupEffect: Gets the effect which is used for startup
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
getAllGrabbers
getAllGrabbers: Get all Grabbers. Wrap function for getServerInfo
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
getAllLedDevices
getAllLedDevices: Get all led devices. Wrap function for getServerInfo
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
getLedMappingType
getLedMappingType: Get the current led mapping type. Wrap function for getServerInfo
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
getAllPriorities
getAllPriorities: Get all priorities. Wrap function for getServerInfo
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
getSysInfo
getSysInfo: Get system information about the operating system of hyperion.ng instance
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
getServerConfig
getServerConfig: Gets the current config file
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
getServerConfigSchema
getServerConfigSchema: Gets the current config schema
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
setMappingTypeMulticolor
setMappingTypeMulticolor: Set the Led Mapping Type to multicolor (classic atmolight)
Parameters
callback
Function
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
callback
Function
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
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 falsecallback
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
callback
Function
Returns Function callback return string from hyperion.ng
setEffect
setEffect: Sets an effect.
Parameters
effectName
string You can use getAllEffects to get the nameduration
number in seconds. Use 0 for infinitecallback
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
callback
Function
Returns Function callback return string from hyperion.ng
setSource
setSource: set a source (priority) to active
Parameters
Returns Function callback return string from hyperion.ng
clearPriority
clearPriority: clears the given priority
Parameters
Returns Function callback return string from hyperion.ng
clearApiPriority
clearApiPriority: clears the priority which is used by this api
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
clearAllPriority
clearAllPriority: clears all priority
Parameters
callback
Function
Returns Function callback return string from hyperion.ng
playStatupEffect
playStatupEffect: plays the startup effect with configured time
Parameters
callback
Function
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