add full support and examples for toggle controller
This commit is contained in:
parent
c7f0c37aa1
commit
f09d03636d
6 changed files with 96 additions and 17 deletions
6
dist/Alex2Node.js
vendored
6
dist/Alex2Node.js
vendored
|
|
@ -111,11 +111,11 @@ class Alex2MQTT extends events_1.EventEmitter {
|
|||
console.log(`[Alex2Node.ts] Creating new device with endpoint: ${endpointId}`);
|
||||
}
|
||||
const normalizedCategory = displayCategory === null
|
||||
? null
|
||||
? [DisplayCategory_1.DisplayCategory.LIGHT]
|
||||
: Array.isArray(displayCategory)
|
||||
? displayCategory
|
||||
: [displayCategory];
|
||||
const device = new Device_1.default(this.client, this.rootTopic, name, endpointId, normalizedCategory || [DisplayCategory_1.DisplayCategory.LIGHT]);
|
||||
: [displayCategory || DisplayCategory_1.DisplayCategory.LIGHT];
|
||||
const device = new Device_1.default(this.client, this.rootTopic, name, endpointId, normalizedCategory);
|
||||
this.devices.push(device);
|
||||
return device;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue