@switchbot/homebridge-switchbot 2.14.1-beta.0 → 3.0.0-beta.1
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/.github/{npm-version-script.js → npm-version-script.cjs} +1 -1
- package/.github/workflows/dependabot.yml +10 -11
- package/CHANGELOG.md +11 -2
- package/LICENSE +1 -1
- package/dist/device/blindtilt.d.ts +10 -6
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +152 -91
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts +10 -6
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +234 -184
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts +10 -6
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +110 -64
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts +10 -6
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +121 -69
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts +10 -6
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +111 -66
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +10 -6
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +165 -107
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/hub.d.ts +10 -6
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +88 -51
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts +10 -6
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +133 -90
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts +10 -6
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +109 -66
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts +10 -6
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +110 -65
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts +11 -7
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +125 -84
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts +10 -6
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +103 -63
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts +10 -6
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +103 -63
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts +10 -6
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +95 -54
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts +10 -6
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +68 -40
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts +10 -6
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +86 -52
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/homebridge-ui/server.js +5 -10
- package/dist/homebridge-ui/server.js.map +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +9 -5
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +105 -71
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts +9 -5
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +78 -46
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts +9 -5
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +41 -25
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts +9 -5
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +62 -39
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.d.ts +9 -5
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +67 -45
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts +9 -5
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +176 -150
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts +9 -5
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +81 -62
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts +9 -5
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +41 -25
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts +9 -5
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +48 -32
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts +8 -9
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +151 -162
- package/dist/platform.js.map +1 -1
- package/dist/settings.js +7 -14
- package/dist/settings.js.map +1 -1
- package/dist/utils.js +1 -5
- package/dist/utils.js.map +1 -1
- package/package.json +20 -9
- package/src/device/blindtilt.ts +84 -72
- package/src/device/bot.ts +191 -180
- package/src/device/ceilinglight.ts +57 -44
- package/src/device/colorbulb.ts +53 -40
- package/src/device/contact.ts +71 -60
- package/src/device/curtain.ts +98 -86
- package/src/device/hub.ts +57 -45
- package/src/device/humidifier.ts +88 -77
- package/src/device/iosensor.ts +67 -55
- package/src/device/lightstrip.ts +56 -43
- package/src/device/lock.ts +91 -81
- package/src/device/meter.ts +63 -51
- package/src/device/meterplus.ts +67 -55
- package/src/device/motion.ts +58 -47
- package/src/device/plug.ts +38 -27
- package/src/device/robotvacuumcleaner.ts +49 -38
- package/src/index.ts +10 -7
- package/src/irdevice/airconditioner.ts +71 -63
- package/src/irdevice/airpurifier.ts +48 -40
- package/src/irdevice/camera.ts +28 -20
- package/src/irdevice/fan.ts +42 -34
- package/src/irdevice/light.ts +48 -40
- package/src/irdevice/other.ts +164 -156
- package/src/irdevice/tv.ts +66 -58
- package/src/irdevice/vacuumcleaner.ts +28 -20
- package/src/irdevice/waterheater.ts +35 -27
- package/src/platform.ts +65 -47
- package/tsconfig.json +11 -13
package/src/device/hub.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CharacteristicValue, PlatformAccessory, Service, Units } from 'homebridge';
|
|
1
|
+
import asyncmqtt from 'async-mqtt';
|
|
2
|
+
import { CharacteristicValue, PlatformAccessory, Service, Units, API, Logging, HAP } from 'homebridge';
|
|
3
3
|
import { MqttClient } from 'mqtt';
|
|
4
4
|
import { hostname } from 'os';
|
|
5
5
|
import { interval } from 'rxjs';
|
|
6
6
|
import { request } from 'undici';
|
|
7
|
-
import { SwitchBotPlatform } from '../platform';
|
|
8
|
-
import { Devices, device, deviceStatus, devicesConfig } from '../settings';
|
|
7
|
+
import { SwitchBotPlatform } from '../platform.js';
|
|
8
|
+
import { Devices, device, deviceStatus, devicesConfig, SwitchBotPlatformConfig } from '../settings.js';
|
|
9
9
|
|
|
10
10
|
export class Hub {
|
|
11
|
+
public readonly api: API;
|
|
12
|
+
public readonly log: Logging;
|
|
13
|
+
public readonly config!: SwitchBotPlatformConfig;
|
|
14
|
+
protected readonly hap: HAP;
|
|
11
15
|
// Services
|
|
12
16
|
lightSensorService?: Service;
|
|
13
17
|
humidityService?: Service;
|
|
@@ -44,21 +48,28 @@ export class Hub {
|
|
|
44
48
|
deviceRefreshRate!: number;
|
|
45
49
|
|
|
46
50
|
// Connection
|
|
47
|
-
private readonly
|
|
48
|
-
private readonly
|
|
51
|
+
private readonly OpenAPI: boolean;
|
|
52
|
+
private readonly BLE: boolean;
|
|
49
53
|
|
|
50
54
|
constructor(
|
|
51
55
|
private readonly platform: SwitchBotPlatform,
|
|
52
56
|
private accessory: PlatformAccessory,
|
|
53
57
|
public device: device & devicesConfig,
|
|
54
58
|
) {
|
|
59
|
+
this.api = this.platform.api;
|
|
60
|
+
this.log = this.platform.log;
|
|
61
|
+
this.config = this.platform.config;
|
|
62
|
+
this.hap = this.api.hap;
|
|
63
|
+
// Connection
|
|
64
|
+
this.BLE = this.device.connectionType === 'BLE' || this.device.connectionType === 'BLE/OpenAPI';
|
|
65
|
+
this.OpenAPI = this.device.connectionType === 'OpenAPI' || this.device.connectionType === 'BLE/OpenAPI';
|
|
55
66
|
// default placeholders
|
|
56
|
-
this.
|
|
67
|
+
this.deviceLogs(device);
|
|
57
68
|
this.refreshRate(device);
|
|
58
69
|
this.context();
|
|
59
70
|
this.setupHistoryService(device);
|
|
60
71
|
this.setupMqtt(device);
|
|
61
|
-
this.
|
|
72
|
+
this.deviceConfig(device);
|
|
62
73
|
|
|
63
74
|
this.CurrentRelativeHumidity = accessory.context.CurrentRelativeHumidity;
|
|
64
75
|
this.CurrentTemperature = accessory.context.CurrentTemperature;
|
|
@@ -68,29 +79,29 @@ export class Hub {
|
|
|
68
79
|
|
|
69
80
|
// set accessory information
|
|
70
81
|
accessory
|
|
71
|
-
.getService(this.
|
|
72
|
-
.setCharacteristic(this.
|
|
73
|
-
.setCharacteristic(this.
|
|
74
|
-
.setCharacteristic(this.
|
|
75
|
-
.setCharacteristic(this.
|
|
82
|
+
.getService(this.hap.Service.AccessoryInformation)!
|
|
83
|
+
.setCharacteristic(this.hap.Characteristic.Manufacturer, 'SwitchBot')
|
|
84
|
+
.setCharacteristic(this.hap.Characteristic.Model, accessory.context.model)
|
|
85
|
+
.setCharacteristic(this.hap.Characteristic.SerialNumber, device.deviceId)
|
|
86
|
+
.setCharacteristic(this.hap.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision);
|
|
76
87
|
|
|
77
88
|
// Temperature Sensor Service
|
|
78
89
|
if (device.hub?.hide_temperature) {
|
|
79
90
|
this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Removing Temperature Sensor Service`);
|
|
80
|
-
this.temperatureService = this.accessory.getService(this.
|
|
91
|
+
this.temperatureService = this.accessory.getService(this.hap.Service.TemperatureSensor);
|
|
81
92
|
accessory.removeService(this.temperatureService!);
|
|
82
93
|
} else if (!this.temperatureService) {
|
|
83
94
|
this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Add Temperature Sensor Service`);
|
|
84
95
|
const temperatureService = `${accessory.displayName} Temperature Sensor`;
|
|
85
|
-
(this.temperatureService = this.accessory.getService(this.
|
|
86
|
-
|| this.accessory.addService(this.
|
|
96
|
+
(this.temperatureService = this.accessory.getService(this.hap.Service.TemperatureSensor)
|
|
97
|
+
|| this.accessory.addService(this.hap.Service.TemperatureSensor)), temperatureService;
|
|
87
98
|
|
|
88
|
-
this.temperatureService.setCharacteristic(this.
|
|
89
|
-
if (!this.temperatureService.testCharacteristic(this.
|
|
90
|
-
this.temperatureService.addCharacteristic(this.
|
|
99
|
+
this.temperatureService.setCharacteristic(this.hap.Characteristic.Name, `${accessory.displayName} Temperature Sensor`);
|
|
100
|
+
if (!this.temperatureService.testCharacteristic(this.hap.Characteristic.ConfiguredName)) {
|
|
101
|
+
this.temperatureService.addCharacteristic(this.hap.Characteristic.ConfiguredName, `${accessory.displayName} Temperature Sensor`);
|
|
91
102
|
}
|
|
92
103
|
this.temperatureService
|
|
93
|
-
.getCharacteristic(this.
|
|
104
|
+
.getCharacteristic(this.hap.Characteristic.CurrentTemperature)
|
|
94
105
|
.setProps({
|
|
95
106
|
unit: Units['CELSIUS'],
|
|
96
107
|
validValueRanges: [-273.15, 100],
|
|
@@ -108,20 +119,20 @@ export class Hub {
|
|
|
108
119
|
// Humidity Sensor Service
|
|
109
120
|
if (device.hub?.hide_humidity) {
|
|
110
121
|
this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Removing Humidity Sensor Service`);
|
|
111
|
-
this.humidityService = this.accessory.getService(this.
|
|
122
|
+
this.humidityService = this.accessory.getService(this.hap.Service.HumiditySensor);
|
|
112
123
|
accessory.removeService(this.humidityService!);
|
|
113
124
|
} else if (!this.humidityService) {
|
|
114
125
|
this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Add Humidity Sensor Service`);
|
|
115
126
|
const humidityService = `${accessory.displayName} Humidity Sensor`;
|
|
116
|
-
(this.humidityService = this.accessory.getService(this.
|
|
117
|
-
|| this.accessory.addService(this.
|
|
127
|
+
(this.humidityService = this.accessory.getService(this.hap.Service.HumiditySensor)
|
|
128
|
+
|| this.accessory.addService(this.hap.Service.HumiditySensor)), humidityService;
|
|
118
129
|
|
|
119
|
-
this.humidityService.setCharacteristic(this.
|
|
120
|
-
if (!this.humidityService.testCharacteristic(this.
|
|
121
|
-
this.humidityService.addCharacteristic(this.
|
|
130
|
+
this.humidityService.setCharacteristic(this.hap.Characteristic.Name, `${accessory.displayName} Humidity Sensor`);
|
|
131
|
+
if (!this.humidityService.testCharacteristic(this.hap.Characteristic.ConfiguredName)) {
|
|
132
|
+
this.humidityService.addCharacteristic(this.hap.Characteristic.ConfiguredName, `${accessory.displayName} Humidity Sensor`);
|
|
122
133
|
}
|
|
123
134
|
this.humidityService
|
|
124
|
-
.getCharacteristic(this.
|
|
135
|
+
.getCharacteristic(this.hap.Characteristic.CurrentRelativeHumidity)
|
|
125
136
|
.setProps({
|
|
126
137
|
minStep: 0.1,
|
|
127
138
|
})
|
|
@@ -135,16 +146,16 @@ export class Hub {
|
|
|
135
146
|
// Light Sensor Service
|
|
136
147
|
if (device.hub?.hide_lightsensor) {
|
|
137
148
|
this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Removing Light Sensor Service`);
|
|
138
|
-
this.lightSensorService = this.accessory.getService(this.
|
|
149
|
+
this.lightSensorService = this.accessory.getService(this.hap.Service.LightSensor);
|
|
139
150
|
accessory.removeService(this.lightSensorService!);
|
|
140
151
|
} else if (!this.lightSensorService) {
|
|
141
152
|
this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Add Light Sensor Service`);
|
|
142
153
|
const lightSensorService = `${accessory.displayName} Light Sensor`;
|
|
143
|
-
(this.lightSensorService = this.accessory.getService(this.
|
|
144
|
-
|| this.accessory.addService(this.
|
|
154
|
+
(this.lightSensorService = this.accessory.getService(this.hap.Service.LightSensor)
|
|
155
|
+
|| this.accessory.addService(this.hap.Service.LightSensor)), lightSensorService;
|
|
145
156
|
|
|
146
|
-
this.lightSensorService.setCharacteristic(this.
|
|
147
|
-
this.lightSensorService.setCharacteristic(this.
|
|
157
|
+
this.lightSensorService.setCharacteristic(this.hap.Characteristic.Name, `${accessory.displayName} Light Sensor`);
|
|
158
|
+
this.lightSensorService.setCharacteristic(this.hap.Characteristic.ConfiguredName, `${accessory.displayName} Light Sensor`);
|
|
148
159
|
} else {
|
|
149
160
|
this.debugLog(`${this.device.deviceType}: ${accessory.displayName} Light Sensor Service Not Added`);
|
|
150
161
|
}
|
|
@@ -168,9 +179,9 @@ export class Hub {
|
|
|
168
179
|
const { temperature, humidity, lightLevel } = context;
|
|
169
180
|
const { CurrentTemperature, CurrentRelativeHumidity, CurrentAmbientLightLevel } = this;
|
|
170
181
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} ` +
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
182
|
+
'(temperature, humidity, lightLevel) = ' +
|
|
183
|
+
`Webhook:(${temperature}, ${humidity}, ${lightLevel}), ` +
|
|
184
|
+
`current:(${CurrentTemperature}, ${CurrentRelativeHumidity}, ${CurrentAmbientLightLevel})`);
|
|
174
185
|
this.CurrentRelativeHumidity = humidity;
|
|
175
186
|
this.CurrentTemperature = temperature;
|
|
176
187
|
this.set_minLux = this.minLux();
|
|
@@ -265,7 +276,7 @@ export class Hub {
|
|
|
265
276
|
}
|
|
266
277
|
} catch (e: any) {
|
|
267
278
|
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
268
|
-
|
|
279
|
+
+ `failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e}`);
|
|
269
280
|
}
|
|
270
281
|
};
|
|
271
282
|
}
|
|
@@ -396,7 +407,7 @@ export class Hub {
|
|
|
396
407
|
);
|
|
397
408
|
}
|
|
398
409
|
if (!this.device.hub?.hide_lightsensor) {
|
|
399
|
-
this.lightSensorService?.setCharacteristic(this.
|
|
410
|
+
this.lightSensorService?.setCharacteristic(this.hap.Characteristic.CurrentAmbientLightLevel, this.CurrentAmbientLightLevel);
|
|
400
411
|
}
|
|
401
412
|
}
|
|
402
413
|
|
|
@@ -469,7 +480,7 @@ export class Hub {
|
|
|
469
480
|
entry['humidity'] = this.CurrentRelativeHumidity;
|
|
470
481
|
}
|
|
471
482
|
this.accessory.context.CurrentRelativeHumidity = this.CurrentRelativeHumidity;
|
|
472
|
-
this.humidityService?.updateCharacteristic(this.
|
|
483
|
+
this.humidityService?.updateCharacteristic(this.hap.Characteristic.CurrentRelativeHumidity, this.CurrentRelativeHumidity);
|
|
473
484
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
474
485
|
+ `updateCharacteristic CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`);
|
|
475
486
|
}
|
|
@@ -487,7 +498,7 @@ export class Hub {
|
|
|
487
498
|
entry['temp'] = this.CurrentTemperature;
|
|
488
499
|
}
|
|
489
500
|
this.accessory.context.CurrentTemperature = this.CurrentTemperature;
|
|
490
|
-
this.temperatureService?.updateCharacteristic(this.
|
|
501
|
+
this.temperatureService?.updateCharacteristic(this.hap.Characteristic.CurrentTemperature, this.CurrentTemperature);
|
|
491
502
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic CurrentTemperature: ${this.CurrentTemperature}`);
|
|
492
503
|
}
|
|
493
504
|
}
|
|
@@ -504,7 +515,7 @@ export class Hub {
|
|
|
504
515
|
entry['lux'] = this.CurrentAmbientLightLevel;
|
|
505
516
|
}
|
|
506
517
|
this.accessory.context.CurrentAmbientLightLevel = this.CurrentAmbientLightLevel;
|
|
507
|
-
this.lightSensorService?.updateCharacteristic(this.
|
|
518
|
+
this.lightSensorService?.updateCharacteristic(this.hap.Characteristic.CurrentAmbientLightLevel, this.CurrentAmbientLightLevel);
|
|
508
519
|
this.debugLog(
|
|
509
520
|
`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
510
521
|
+ `updateCharacteristic CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`,
|
|
@@ -544,6 +555,7 @@ export class Hub {
|
|
|
544
555
|
async setupMqtt(device: device & devicesConfig): Promise<void> {
|
|
545
556
|
if (device.mqttURL) {
|
|
546
557
|
try {
|
|
558
|
+
const { connectAsync } = asyncmqtt;
|
|
547
559
|
this.mqttClient = await connectAsync(device.mqttURL, device.mqttOptions || {});
|
|
548
560
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} MQTT connection has been established successfully.`);
|
|
549
561
|
this.mqttClient.on('error', (e: Error) => {
|
|
@@ -624,13 +636,13 @@ export class Hub {
|
|
|
624
636
|
|
|
625
637
|
async apiError(e: any): Promise<void> {
|
|
626
638
|
if (!this.device.hub?.hide_temperature) {
|
|
627
|
-
this.temperatureService?.updateCharacteristic(this.
|
|
639
|
+
this.temperatureService?.updateCharacteristic(this.hap.Characteristic.CurrentTemperature, e);
|
|
628
640
|
}
|
|
629
641
|
if (!this.device.hub?.hide_humidity) {
|
|
630
|
-
this.humidityService?.updateCharacteristic(this.
|
|
642
|
+
this.humidityService?.updateCharacteristic(this.hap.Characteristic.CurrentRelativeHumidity, e);
|
|
631
643
|
}
|
|
632
644
|
if (!this.device.hub?.hide_lightsensor) {
|
|
633
|
-
this.lightSensorService?.updateCharacteristic(this.
|
|
645
|
+
this.lightSensorService?.updateCharacteristic(this.hap.Characteristic.CurrentAmbientLightLevel, e);
|
|
634
646
|
}
|
|
635
647
|
}
|
|
636
648
|
|
|
@@ -693,7 +705,7 @@ export class Hub {
|
|
|
693
705
|
}
|
|
694
706
|
}
|
|
695
707
|
|
|
696
|
-
async
|
|
708
|
+
async deviceConfig(device: device & devicesConfig): Promise<void> {
|
|
697
709
|
let config = {};
|
|
698
710
|
if (device.hub) {
|
|
699
711
|
config = device.hub;
|
|
@@ -715,7 +727,7 @@ export class Hub {
|
|
|
715
727
|
}
|
|
716
728
|
}
|
|
717
729
|
|
|
718
|
-
async
|
|
730
|
+
async deviceLogs(device: device & devicesConfig): Promise<void> {
|
|
719
731
|
if (this.platform.debugMode) {
|
|
720
732
|
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
721
733
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|