Constructor
new MlscRestClient(config)
- Description:
Be aware that you need to call
scheduleStateFetching
andcreateCommandHandlingRule
to fully initialize the REST client.
- Source:
Example
var { thingsx } = require('@hotzware/openhab-tools');
var mlsc = new thingsx.MlscRestClient({
effectItemName: 'FlorianRGB_effect',
url: 'http://127.0.0.1:8080',
deviceId: 'device_0',
colorItemName: 'FlorianRGB_color',
dimmerItemName: 'FlorianRGB_dimmer'
});
mlsc.scheduleStateFetching();
mlsc.createCommandHandlingRule();
Parameters:
Name | Type | Description |
---|---|---|
config |
MlscRestClientConfig | mlsc REST client config |
Methods
createCommandHandlingRule()
- Description:
Creates the rule used for command handling.
- Source:
getAvailableEffects() → {Object}
- Description:
Get all available music and non-music effects.
- Source:
Returns:
- Type
- Object
scheduleStateFetching() → {NodeJS.Timeout}
- Description:
Schedules the state fetching using
setInterval
.
- Source:
Returns:
intervalId
of the interval used for state fetching
- Type
- NodeJS.Timeout