Add full support for mode controller

This commit is contained in:
David 2025-05-12 18:23:58 +00:00
parent e7a2079ff7
commit 3bcd767127
8 changed files with 198 additions and 6 deletions

3
dist/Alex2Node.js vendored
View file

@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const mqtt_1 = __importDefault(require("mqtt"));
const Device_1 = __importDefault(require("./Device"));
const events_1 = require("events");
const DisplayCategory_1 = require("./DisplayCategory");
class Alex2MQTT extends events_1.EventEmitter {
constructor(username, password, rootTopic, debugLogging) {
super(); // Initialize EventEmitter
@ -114,7 +115,7 @@ class Alex2MQTT extends events_1.EventEmitter {
: Array.isArray(displayCategory)
? displayCategory
: [displayCategory];
const device = new Device_1.default(this.client, this.rootTopic, name, endpointId, normalizedCategory);
const device = new Device_1.default(this.client, this.rootTopic, name, endpointId, normalizedCategory || [DisplayCategory_1.DisplayCategory.LIGHT]);
this.devices.push(device);
return device;
}