added constructor parameter check
This commit is contained in:
parent
c7405a3e13
commit
913580aec2
@ -25,6 +25,10 @@ class HCMagicHome extends HCColorLamp {
|
|||||||
constructor(config) {
|
constructor(config) {
|
||||||
super(config);
|
super(config);
|
||||||
|
|
||||||
|
if (!("address" in this._configuration)) {
|
||||||
|
throw new Error(`Required configuration field "address" is missing"`);
|
||||||
|
}
|
||||||
|
|
||||||
let type = "type1";
|
let type = "type1";
|
||||||
if (this._configuration.type != undefined) {
|
if (this._configuration.type != undefined) {
|
||||||
type = this._configuration.type;
|
type = this._configuration.type;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user