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.
@@ -13,7 +13,7 @@
13
13
  "type": "array",
14
14
  "items": {
15
15
  "type": "object",
16
- "title": "Network",
16
+ "title": "Device",
17
17
  "properties": {
18
18
  "name": {
19
19
  "title": "Name",
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "OpenWrt Control",
3
3
  "name": "homebridge-openwrt-control",
4
- "version": "0.0.2-beta.33",
4
+ "version": "0.0.2-beta.35",
5
5
  "description": "Homebridge plugin to control OpenWrt flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -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(`${this.host}${this.openWrtInfo.systemInfo.hostname}`);
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