From 513ad0727e9b6a33813568f837e5fcb8998ca15c Mon Sep 17 00:00:00 2001 From: jangxx Date: Tue, 29 Jan 2019 21:39:25 +0100 Subject: [PATCH] hopefully finished a stable 1.0.0 --- ControlBase.js | 8 ++++++++ states/BaseState.js | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ControlBase.js b/ControlBase.js index 49d6d19..f23e723 100644 --- a/ControlBase.js +++ b/ControlBase.js @@ -29,6 +29,14 @@ class HCControlBase extends EventEmitter { return this._name; } + /** + * Run some sort of asynchronous initialization + * @returns A promise which resolves when the initialization is complete + */ + init() { + return Promise.resolve(); + } + /** * Updates the state by polling the controlled device * @returns A promise which resolves when the state has been pulled diff --git a/states/BaseState.js b/states/BaseState.js index 0fcf0ef..1df98d8 100644 --- a/states/BaseState.js +++ b/states/BaseState.js @@ -1,4 +1,4 @@ -const objectHash = require('node-object-hash'); +const objectHash = require('node-object-hash')(); class BaseState { constructor(cloneObj) { @@ -9,7 +9,7 @@ class BaseState { } get hash() { - return objectHash(this.asObj); + return objectHash.hash(this.asObj); } static get default() {