homebridge-openwrt-control 0.0.2-beta.33 → 0.0.2-beta.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.schema.json +1 -1
- package/index.js +6 -0
- package/package.json +1 -1
- package/src/accesspoint.js +3 -4
package/config.schema.json
CHANGED
package/index.js
CHANGED
|
@@ -92,6 +92,12 @@ class OpenWrtPlatform {
|
|
|
92
92
|
// create device clases
|
|
93
93
|
const DeviceClasses = { accessPoint: AccessPoint, switch: Switch };
|
|
94
94
|
const DeviceClass = DeviceClasses[device];
|
|
95
|
+
|
|
96
|
+
if (!DeviceClass) {
|
|
97
|
+
if (logLevel.warn) log.warn(`Device: ${host} ${name}, class not found for: ${device}`);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
95
101
|
const type = new DeviceClass(api, deviceConfig, openWrt, openWrtInfo)
|
|
96
102
|
.on('devInfo', msg => logLevel.devInfo && log.info(msg))
|
|
97
103
|
.on('success', msg => logLevel.success && log.success(`Device: ${host} ${name}, ${msg}`))
|
package/package.json
CHANGED
package/src/accesspoint.js
CHANGED
|
@@ -122,18 +122,17 @@ class AccessPoint extends EventEmitter {
|
|
|
122
122
|
//prepare accessory
|
|
123
123
|
if (this.logDebug) this.emit('debug', `prepare accessory`);
|
|
124
124
|
const accessoryName = this.name;
|
|
125
|
-
const accessoryUUID = AccessoryUUID.generate(
|
|
125
|
+
const accessoryUUID = AccessoryUUID.generate(this.host + this.openWrtInfo.systemInfo.hostname);
|
|
126
126
|
const accessoryCategory = Categories.AIRPORT;
|
|
127
127
|
const accessory = new Accessory(accessoryName, accessoryUUID, accessoryCategory);
|
|
128
128
|
|
|
129
129
|
//prepare information service
|
|
130
130
|
if (this.logDebug) this.emit('debug', `prepare information service`);
|
|
131
|
-
accessory.getService(Service.AccessoryInformation)
|
|
131
|
+
this.informationService = accessory.getService(Service.AccessoryInformation)
|
|
132
132
|
.setCharacteristic(Characteristic.Manufacturer, this.openWrtInfo.systemInfo.release.distribution || 'OpenWrt')
|
|
133
133
|
.setCharacteristic(Characteristic.Model, this.openWrtInfo.systemInfo.model)
|
|
134
134
|
.setCharacteristic(Characteristic.SerialNumber, this.openWrtInfo.systemInfo.system)
|
|
135
|
-
.setCharacteristic(Characteristic.FirmwareRevision, this.openWrtInfo.systemInfo.release?.version)
|
|
136
|
-
.setCharacteristic(Characteristic.ConfiguredName, accessoryName);
|
|
135
|
+
.setCharacteristic(Characteristic.FirmwareRevision, this.openWrtInfo.systemInfo.release?.version);
|
|
137
136
|
|
|
138
137
|
if (this.logDebug) this.emit('debug', `prepare service`);
|
|
139
138
|
|