homecontrol-control-base/ControlBase.js
2019-01-25 16:14:16 +01:00

33 lines
625 B
JavaScript

const { EventEmitter } = require('events');
const BaseState = require('./states/BaseState');
class HCControlBase extends EventEmitter {
/**
* @param {Object} configuration
* @param {BaseState} state
*/
constructor(configuration, state) {
super();
this._configuration = configuration;
this._state = state;
}
get state() {
return this._state.clone();
}
get type() {
return "none";
}
/**
* Updates the state by polling the controlled device
* @returns A promise which resolves when the state has been pulled
*/
pullState() {
return Promise.resolve();
}
}
module.exports = HCControlBase;