added constructor parameter check
This commit is contained in:
parent
c7405a3e13
commit
913580aec2
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user