added constructor parameter check

This commit is contained in:
jangxx 2019-01-29 22:10:49 +01:00
parent c7405a3e13
commit 913580aec2

View File

@ -25,6 +25,10 @@ class HCMagicHome extends HCColorLamp {
constructor(config) {
super(config);
if (!("address" in this._configuration)) {
throw new Error(`Required configuration field "address" is missing"`);
}
let type = "type1";
if (this._configuration.type != undefined) {
type = this._configuration.type;