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 = {
|
module.exports = {
|
||||||
HCColorLamp: require('./ColorlampBase'),
|
HCColorLamp: require('./ColorlampBase'),
|
||||||
HCSwitch: require('./SwitchBase'),
|
HCSwitch: require('./SwitchBase'),
|
||||||
|
HCFogmachine: require('./FogmachineBase'),
|
||||||
StateUpdateManager: require('./StateUpdateManager'),
|
StateUpdateManager: require('./StateUpdateManager'),
|
||||||
};
|
};
|
||||||
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "homecontrol-control-base",
|
"name": "homecontrol-control-base",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "homecontrol-control-base",
|
"name": "homecontrol-control-base",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"description": "Base class which all hc-controls inherit from",
|
"description": "Base class which all hc-controls inherit from",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"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