added support for fogmachines
This commit is contained in:
parent
b7ed807aff
commit
c37d47a85b
18
FogmachineBase.js
Normal file
18
FogmachineBase.js
Normal file
@ -0,0 +1,18 @@
|
||||
const HCControlBase = require('./ControlBase');
|
||||
const FogmachineState = require('./states/FogmachineState');
|
||||
|
||||
class HCFogmachineBase extends HCControlBase {
|
||||
constructor(config) {
|
||||
super(config, new FogmachineState());
|
||||
}
|
||||
|
||||
get type() {
|
||||
return "fogmachine";
|
||||
}
|
||||
|
||||
triggerFor(milliseconds) {
|
||||
return Promise.reject("Not implemented");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = HCFogmachineBase;
|
||||
1
index.js
1
index.js
@ -1,5 +1,6 @@
|
||||
module.exports = {
|
||||
HCColorLamp: require('./ColorlampBase'),
|
||||
HCSwitch: require('./SwitchBase'),
|
||||
HCFogmachine: require('./FogmachineBase'),
|
||||
StateUpdateManager: require('./StateUpdateManager'),
|
||||
};
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "homecontrol-control-base",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "homecontrol-control-base",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.0",
|
||||
"description": "Base class which all hc-controls inherit from",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
27
states/FogmachineState.js
Normal file
27
states/FogmachineState.js
Normal file
@ -0,0 +1,27 @@
|
||||
const mergeOptions = require('merge-options');
|
||||
|
||||
const BaseState = require('./BaseState');
|
||||
|
||||
class FogmachineState extends BaseState {
|
||||
constructor(cloneObj) {
|
||||
super();
|
||||
|
||||
let cloneState = mergeOptions(FogmachineState.default, cloneObj);
|
||||
|
||||
this.ready = cloneState.ready;
|
||||
}
|
||||
|
||||
static get default() {
|
||||
return {
|
||||
ready: false
|
||||
};
|
||||
}
|
||||
|
||||
get asObj() {
|
||||
return {
|
||||
ready: this.ready
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = FogmachineState;
|
||||
Loading…
Reference in New Issue
Block a user