homebridge-openwrt-control 0.2.0 → 0.2.1-beta.0

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.
Files changed (3) hide show
  1. package/README.md +10 -10
  2. package/package.json +1 -1
  3. package/src/router.js +6 -6
package/README.md CHANGED
@@ -58,8 +58,8 @@
58
58
  | Key | Description |
59
59
  | --- | --- |
60
60
  | `name` | Here set Your own device name. |
61
- | `host` | Here set the device `Hsostname or Address IP`.|
62
- | `displayType` | Here enable or disable this device: `0 - Disable`, `1 - Enable`. |
61
+ | `host` | Here set the device `IP Address` or `Hostname`.|
62
+ | `displayType` | Here set the device state: `0 - Disable`, `1 - Enable`. |
63
63
  | `auth{}` | Authorization object. |
64
64
  | `auth.enable` | Here enable authorizatin credentials. |
65
65
  | `auth.user` | Here set the authorization `Username`. |
@@ -68,11 +68,11 @@
68
68
  | `wireless.radio{}` | Wireless `Radio` object. |
69
69
  | `wireless.radio.control{}` | Wireless `Radio` control object. |
70
70
  | `wireless.radio.control.displayType` | Aaccessory type for `Radio` control in Home app: `0` - Disabled, `1` - Switch, `2` - Outlet, `3` - Lightbulb. |
71
- | `wireless.radio.control.namePrefix` | Here enable device name as a prefix for `Radios` control name. |
71
+ | `wireless.radio.control.namePrefix` | Here enable device name as a prefix for `Radio` control name. |
72
72
  | `wireless.radio.sensor{}` | Wireless `Radio` sensor object. |
73
73
  | `wireless.radio.sensor.displayType` | Accessory type for `Radio` sensor in Home app: `0` - Disabled, `1` - Motion Sensor, `2` - Occupancy Sensor, `3` - Contact Sensor. |
74
74
  | `wireless.radio.control.restart` | Here enable restart `Radio` instead of toggle. |
75
- | `wireless.radio.sensor.namePrefix` | Here enable device name as a prefix for `Radios` sensor name. |
75
+ | `wireless.radio.sensor.namePrefix` | Here enable device name as a prefix for `Radio` sensor name. |
76
76
  | `wireless.ssid{}` | Wireless `SSID` object. |
77
77
  | `wireless.ssid.control{}` | Wireless `SSID` control object. |
78
78
  | `wireless.ssid.control.displayType` | Aaccessory type for `SSID` control in Home app: `0` - Disabled, `1` - Switch, `2` - Outlet, `3` - Lightbulb. |
@@ -81,12 +81,12 @@
81
81
  | `wireless.ssid.sensor.displayType` | Accessory type for `SSID` sensor in Home app: `0` - Disabled, `1` - Motion Sensor, `2` - Occupancy Sensor, `3` - Contact Sensor. |
82
82
  | `wireless.ssid.sensor.namePrefix` | Here enable device name as a prefix for `SSID` sensor name. |
83
83
  | `buttons[]` | Buttons array. |
84
- | `buttons[].displayType` | Accessory type for `Buttons` in HomeKit app, possible `0` - Disabled, `1` - Outlet, `2` - Switch. |
84
+ | `buttons[].displayType` | Accessory type for `Button` in Home app, possible `0` - Disabled, `1` - Outlet, `2` - Switch. |
85
85
  | `buttons[].name` | Here set button `Name` which You want expose to the `Homebridge/HomeKit`.|
86
86
  | `buttons[].command` | Here choose command which will be assigned to the button. |
87
87
  | `buttons[].namePrefix` | Here enable device name as a prefix for the `Button` name. |
88
88
  | `refreshInterval` | Here set the data refresh time in seconds. |
89
- | `log.deviceInfo` | If enabled, log device info will be displayed by every connections device to the network. |
89
+ | `log.deviceInfo` | If enabled, log device info will be displayed by every restart of plugin. |
90
90
  | `log.success` | If enabled, success log will be displayed in console. |
91
91
  | `log.info` | If enabled, info log will be displayed in console. |
92
92
  | `log.warn` | If enabled, warn log will be displayed in console. |
@@ -113,13 +113,13 @@ Path `status` response all available paths.
113
113
 
114
114
  | Method | URL | Path | Response | Type |
115
115
  | --- | --- | --- | --- | --- |
116
- | GET | `http//ip:port` | `info` | `{ state: false, info: '', systemInfo: {}, networkInfo: {}, wirelessInfo: {}, wirelessRadios: [], wirelessSsids: [] }` | JSON |
116
+ | GET | `http//ip:port` | `info` | `{ state: false, info: '', linkUp:false, systemInfo: {}, networkInfo: {}, wirelessInfo: {}, wirelessRadios: [], wirelessSsids: [] }` | JSON |
117
117
 
118
118
  | Method | URL | Key | Value | Type | Description |
119
119
  | --- | --- | --- | --- | --- | --- |
120
120
  | POST | `http//ip:port` | `SystemReboot` | `true` | boolean | Reboot device |
121
121
  | | `http//ip:port` | `NetworkReload` | `true` | boolean | Network reload |
122
- | | `http//ip:port` | `WiFiReload` | `true` | boolean | WiFi Reload |
122
+ | | `http//ip:port` | `WiFiReload` | `true` | boolean | Wireless Reload |
123
123
 
124
124
  ### MQTT Integration
125
125
 
@@ -127,10 +127,10 @@ Subscribe using JSON `{ "SystemReboot": true }`
127
127
 
128
128
  | Method | Topic | Message | Type |
129
129
  | --- | --- | --- | --- |
130
- | Publish | `Info` | `{ state: false, info: '', systemInfo: {}, networkInfo: {}, wirelessInfo: {}, wirelessRadios: [], wirelessSsids: [] }` | JSON |
130
+ | Publish | `Info` | `{ state: false, info: '', linkUp: false, systemInfo: {}, networkInfo: {}, wirelessInfo: {}, wirelessRadios: [], wirelessSsids: [] }` | JSON |
131
131
 
132
132
  | Method | Topic | Key | Value | Type | Description |
133
133
  | --- | --- | --- | --- | --- | --- |
134
134
  | Subscribe | `Set` | `SystemReboot` | `true` | boolean | Reboot device |
135
135
  | | `Set` | `NetworkReload` | `true` | boolean | Network reload |
136
- | | `Set` | `WiFiReload` | `true` | boolean | WiFi Reload |
136
+ | | `Set` | `WiFiReload` | `true` | boolean | Wireless Reload |
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "OpenWrt Control",
3
3
  "name": "homebridge-openwrt-control",
4
- "version": "0.2.0",
4
+ "version": "0.2.1-beta.0",
5
5
  "description": "Homebridge plugin to control OpenWrt flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/router.js CHANGED
@@ -50,7 +50,7 @@ class Router extends EventEmitter {
50
50
  this.informationService?.updateCharacteristic(Characteristic.FirmwareRevision, openWrtInfo.systemInfo.release?.version);
51
51
 
52
52
  const linkUp = openWrtInfo.linkUp ? 1 : 2; // 0= Not Supported, 1=Connected, 2=Disconnected
53
- this.routerService?.updateCharacteristic(Characteristic.WiFiSatelliteStatus, linkUp);
53
+ this.routerService?.updateCharacteristic(Characteristic.RouterStatus, linkUp);
54
54
 
55
55
  // RADIOS
56
56
  const currentRadios = [];
@@ -137,7 +137,7 @@ class Router extends EventEmitter {
137
137
  } else {
138
138
  const characteristicType = [null, Characteristic.On, Characteristic.On, Characteristic.On][this.wirelessSsidControl.displayType];
139
139
  existing.setCharacteristic(Characteristic.ConfiguredName, serviceName)
140
- .updateCharacteristic(characteristicType, !state);
140
+ .updateCharacteristic(Characteristic.WiFiSatelliteStatus, !state);
141
141
  }
142
142
  }
143
143
 
@@ -311,10 +311,10 @@ class Router extends EventEmitter {
311
311
  if (this.wirelessSsidControl.displayType > 0) {
312
312
  const serviceType = [null, Service.Switch, Service.Outlet, Service.Lightbulb][this.wirelessSsidControl.displayType];
313
313
  const serviceName = this.wirelessSsidControl.namePrefix ? `${accessoryName} ${name} ${band}` : `${name} ${band}`;
314
- const service = this.accessory.addService(serviceType, serviceName, ssidId);
314
+ const service = this.accessory.addService(Service.WiFiSatellite, serviceName, ssidId);
315
315
  service.addOptionalCharacteristic(Characteristic.ConfiguredName);
316
316
  service.setCharacteristic(Characteristic.ConfiguredName, serviceName);
317
- service.getCharacteristic(Characteristic.On)
317
+ service.getCharacteristic(Characteristic.WiFiSatelliteStatus)
318
318
  .onGet(async () => {
319
319
  const current = this.openWrtInfo.wirelessSsids.find(s => s.name === name && s.device === radio && s.band === band);
320
320
  return current ? !current.disabled : false;
@@ -358,11 +358,11 @@ class Router extends EventEmitter {
358
358
  .setCharacteristic(Characteristic.FirmwareRevision, this.openWrtInfo.systemInfo.release?.version);
359
359
 
360
360
  // Router
361
- const routerService = new Service.WiFiSatellite(this.name, 'routerService');
361
+ const routerService = new Service.Router(this.name, 'routerService');
362
362
  routerService.setPrimaryService(true);
363
363
  routerService.addOptionalCharacteristic(Characteristic.ConfiguredName);
364
364
  routerService.setCharacteristic(Characteristic.ConfiguredName, this.name);
365
- routerService.getCharacteristic(Characteristic.WiFiSatelliteStatus)
365
+ routerService.getCharacteristic(Characteristic.RouterStatus)
366
366
  .onGet(async () => {
367
367
  const linkUp = this.openWrtInfo.linkUp ? 1 : 2; // 0= Not Supported, 1=Connected, 2=Disconnected
368
368
  return linkUp;