@switchbot/homebridge-switchbot 2.0.0-beta.4 → 2.0.0-beta.40
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/CHANGELOG.md +12 -2
- package/README.md +3 -2
- package/config.schema.json +108 -20
- package/dist/device/bot.d.ts +34 -28
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +657 -648
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts +137 -0
- package/dist/device/ceilinglight.d.ts.map +1 -0
- package/dist/device/ceilinglight.js +1127 -0
- package/dist/device/ceilinglight.js.map +1 -0
- package/dist/device/colorbulb.d.ts +36 -19
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +486 -309
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts +18 -8
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +306 -237
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +23 -16
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +566 -502
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/humidifier.d.ts +24 -18
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +453 -369
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/lock.d.ts +27 -8
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +305 -148
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts +22 -16
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +367 -267
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts +24 -12
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +381 -213
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts +18 -8
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +279 -216
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts +27 -17
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +295 -251
- package/dist/device/plug.js.map +1 -1
- package/dist/device/striplight.d.ts +43 -19
- package/dist/device/striplight.d.ts.map +1 -1
- package/dist/device/striplight.js +506 -262
- package/dist/device/striplight.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +9 -12
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +278 -230
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts +5 -3
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +154 -104
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts +11 -8
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +133 -86
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts +10 -7
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +160 -109
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.d.ts +11 -8
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +137 -103
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts +11 -8
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +145 -98
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts +12 -9
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +143 -93
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts +9 -10
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +132 -89
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts +8 -9
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +132 -89
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts +15 -12
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +574 -454
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +21 -11
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/homebridge-ui/public/index.html +1 -0
- package/package.json +13 -11
- package/src/device/bot.ts +656 -659
- package/src/device/ceilinglight.ts +1208 -0
- package/src/device/colorbulb.ts +490 -344
- package/src/device/contact.ts +309 -241
- package/src/device/curtain.ts +571 -516
- package/src/device/humidifier.ts +456 -403
- package/src/device/lock.ts +314 -149
- package/src/device/meter.ts +378 -280
- package/src/device/meterplus.ts +391 -219
- package/src/device/motion.ts +285 -222
- package/src/device/plug.ts +299 -260
- package/src/device/striplight.ts +522 -289
- package/src/irdevice/airconditioner.ts +282 -241
- package/src/irdevice/airpurifier.ts +151 -103
- package/src/irdevice/camera.ts +131 -85
- package/src/irdevice/fan.ts +157 -106
- package/src/irdevice/light.ts +135 -103
- package/src/irdevice/other.ts +143 -97
- package/src/irdevice/tv.ts +142 -93
- package/src/irdevice/vacuumcleaner.ts +131 -89
- package/src/irdevice/waterheater.ts +130 -89
- package/src/platform.ts +567 -476
- package/src/settings.ts +22 -11
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import https from 'https';
|
|
2
2
|
import crypto from 'crypto';
|
|
3
3
|
import { IncomingMessage } from 'http';
|
|
4
|
+
import superStringify from 'super-stringify';
|
|
4
5
|
import { SwitchBotPlatform } from '../platform';
|
|
5
6
|
import { irDevicesConfig, irdevice, HostDomain, DevicePath } from '../settings';
|
|
6
7
|
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
|
|
@@ -16,7 +17,6 @@ export class VacuumCleaner {
|
|
|
16
17
|
|
|
17
18
|
// Characteristic Values
|
|
18
19
|
On!: CharacteristicValue;
|
|
19
|
-
OnCached!: CharacteristicValue;
|
|
20
20
|
|
|
21
21
|
// Config
|
|
22
22
|
deviceLogging!: string;
|
|
@@ -25,23 +25,22 @@ export class VacuumCleaner {
|
|
|
25
25
|
// default placeholders
|
|
26
26
|
this.logs(device);
|
|
27
27
|
this.config(device);
|
|
28
|
-
|
|
29
|
-
this.On = false;
|
|
30
|
-
} else {
|
|
31
|
-
this.On = this.accessory.context.On;
|
|
32
|
-
}
|
|
28
|
+
this.context();
|
|
33
29
|
|
|
34
30
|
// set accessory information
|
|
35
31
|
accessory
|
|
36
32
|
.getService(this.platform.Service.AccessoryInformation)!
|
|
37
33
|
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'SwitchBot')
|
|
38
34
|
.setCharacteristic(this.platform.Characteristic.Model, device.remoteType)
|
|
39
|
-
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
35
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.deviceId!)
|
|
36
|
+
.setCharacteristic(this.platform.Characteristic.FirmwareRevision, this.FirmwareRevision(accessory, device))
|
|
37
|
+
.getCharacteristic(this.platform.Characteristic.FirmwareRevision)
|
|
38
|
+
.updateValue(this.FirmwareRevision(accessory, device));
|
|
40
39
|
|
|
41
40
|
// get the Television service if it exists, otherwise create a new Television service
|
|
42
41
|
// you can create multiple services for each accessory
|
|
43
42
|
(this.switchService = accessory.getService(this.platform.Service.Switch) || accessory.addService(this.platform.Service.Switch)),
|
|
44
|
-
`${accessory.displayName}
|
|
43
|
+
`${accessory.displayName} ${device.remoteType}`;
|
|
45
44
|
|
|
46
45
|
// To avoid "Cannot add a Service with the same UUID another Service without also defining a unique 'subtype' property." error,
|
|
47
46
|
// when creating multiple services of the same type, you need to use the following syntax to specify a name and subtype id:
|
|
@@ -56,8 +55,9 @@ export class VacuumCleaner {
|
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
async OnSet(value: CharacteristicValue): Promise<void> {
|
|
59
|
-
this.debugLog(
|
|
58
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${value}`);
|
|
60
59
|
this.On = value;
|
|
60
|
+
this.accessory.context.On = this.On;
|
|
61
61
|
if (this.On) {
|
|
62
62
|
await this.pushOnChanges();
|
|
63
63
|
} else {
|
|
@@ -65,28 +65,15 @@ export class VacuumCleaner {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
async updateHomeKitCharacteristics(): Promise<void> {
|
|
69
|
-
if (this.On === undefined) {
|
|
70
|
-
this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} On: ${this.On}`);
|
|
71
|
-
} else {
|
|
72
|
-
this.switchService?.updateCharacteristic(this.platform.Characteristic.On, this.On);
|
|
73
|
-
this.debugLog(`Vacuum Cleaner: ${this.accessory.displayName} updateCharacteristic On: ${this.On}`);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
68
|
/**
|
|
78
69
|
* Pushes the requested changes to the SwitchBot API
|
|
79
|
-
* deviceType
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* Light: "command" "volumeAdd" "default" = volume up
|
|
83
|
-
* Light: "command" "volumeSub" "default" = volume down
|
|
84
|
-
* Light: "command" "channelAdd" "default" = next channel
|
|
85
|
-
* Light: "command" "channelSub" "default" = previous channel
|
|
70
|
+
* deviceType CommandType Command Parameter Description
|
|
71
|
+
* Vacuum Cleaner "command" "turnOff" "default" set to OFF state
|
|
72
|
+
* Vacuum Cleaner "command" "turnOn" "default" set to ON state
|
|
86
73
|
*/
|
|
87
74
|
async pushOnChanges(): Promise<void> {
|
|
88
75
|
if (this.On) {
|
|
89
|
-
const body =
|
|
76
|
+
const body = superStringify({
|
|
90
77
|
'command': 'turnOn',
|
|
91
78
|
'parameter': 'default',
|
|
92
79
|
'commandType': 'command',
|
|
@@ -97,7 +84,7 @@ export class VacuumCleaner {
|
|
|
97
84
|
|
|
98
85
|
async pushOffChanges(): Promise<void> {
|
|
99
86
|
if (!this.On) {
|
|
100
|
-
const body =
|
|
87
|
+
const body = superStringify({
|
|
101
88
|
'command': 'turnOff',
|
|
102
89
|
'parameter': 'default',
|
|
103
90
|
'commandType': 'command',
|
|
@@ -106,94 +93,127 @@ export class VacuumCleaner {
|
|
|
106
93
|
}
|
|
107
94
|
}
|
|
108
95
|
|
|
109
|
-
async pushChanges(body): Promise<void> {
|
|
110
|
-
|
|
96
|
+
async pushChanges(body: any[]): Promise<void> {
|
|
97
|
+
if (this.device.connectionType === 'OpenAPI') {
|
|
98
|
+
try {
|
|
111
99
|
// Make Push On request to the API
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
100
|
+
const t = Date.now();
|
|
101
|
+
const nonce = 'requestID';
|
|
102
|
+
const data = this.platform.config.credentials?.token + t + nonce;
|
|
103
|
+
const signTerm = crypto.createHmac('sha256', this.platform.config.credentials?.secret)
|
|
104
|
+
.update(Buffer.from(data, 'utf-8'))
|
|
105
|
+
.digest();
|
|
106
|
+
const sign = signTerm.toString('base64');
|
|
107
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} sign: ${sign}`);
|
|
108
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API. body: ${body},`);
|
|
109
|
+
const options = {
|
|
110
|
+
hostname: HostDomain,
|
|
111
|
+
port: 443,
|
|
112
|
+
path: `${DevicePath}/${this.device.deviceId}/commands`,
|
|
113
|
+
method: 'POST',
|
|
114
|
+
headers: {
|
|
115
|
+
'Authorization': this.platform.config.credentials?.token,
|
|
116
|
+
'sign': sign,
|
|
117
|
+
'nonce': nonce,
|
|
118
|
+
't': t,
|
|
119
|
+
'Content-Type': 'application/json',
|
|
120
|
+
'Content-Length': body.length,
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
const req = https.request(options, res => {
|
|
124
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushchanges statusCode: ${res.statusCode}`);
|
|
125
|
+
this.statusCode({ res });
|
|
126
|
+
res.on('data', d => {
|
|
127
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} d: ${d}`);
|
|
128
|
+
});
|
|
140
129
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
if (this.deviceLogging.includes('debug')) {
|
|
154
|
-
this.errorLog(
|
|
155
|
-
`Vacuum Cleaner: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,` +
|
|
156
|
-
` Error Message: ${JSON.stringify(e.message)}`,
|
|
130
|
+
req.on('error', (e: any) => {
|
|
131
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} error message: ${e.message}`);
|
|
132
|
+
});
|
|
133
|
+
req.write(body);
|
|
134
|
+
req.end();
|
|
135
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} pushchanges: ${superStringify(req)}`);
|
|
136
|
+
this.accessory.context.On = this.On;
|
|
137
|
+
this.updateHomeKitCharacteristics();
|
|
138
|
+
} catch (e: any) {
|
|
139
|
+
this.apiError(e);
|
|
140
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} failed pushChanges with ${this.device.connectionType} Connection,`
|
|
141
|
+
+ ` Error Message: ${superStringify(e.message)}`,
|
|
157
142
|
);
|
|
158
143
|
}
|
|
159
|
-
|
|
144
|
+
} else {
|
|
145
|
+
this.warnLog(`${this.device.remoteType}: ${this.accessory.displayName}`
|
|
146
|
+
+ ` Connection Type: ${this.device.connectionType}, commands will not be sent to OpenAPI`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
async updateHomeKitCharacteristics(): Promise<void> {
|
|
151
|
+
if (this.On === undefined) {
|
|
152
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} On: ${this.On}`);
|
|
153
|
+
} else {
|
|
154
|
+
this.accessory.context.On = this.On;
|
|
155
|
+
this.switchService?.updateCharacteristic(this.platform.Characteristic.On, this.On);
|
|
156
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} updateCharacteristic On: ${this.On}`);
|
|
160
157
|
}
|
|
161
158
|
}
|
|
162
159
|
|
|
163
160
|
async statusCode({ res }: { res: IncomingMessage }): Promise<void> {
|
|
164
161
|
switch (res.statusCode) {
|
|
165
162
|
case 151:
|
|
166
|
-
this.errorLog(
|
|
163
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Command not supported by this device type.`);
|
|
167
164
|
break;
|
|
168
165
|
case 152:
|
|
169
|
-
this.errorLog(
|
|
166
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Device not found.`);
|
|
170
167
|
break;
|
|
171
168
|
case 160:
|
|
172
|
-
this.errorLog(
|
|
169
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Command is not supported.`);
|
|
173
170
|
break;
|
|
174
171
|
case 161:
|
|
175
|
-
this.errorLog(
|
|
172
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Device is offline.`);
|
|
176
173
|
break;
|
|
177
174
|
case 171:
|
|
178
|
-
this.errorLog(
|
|
175
|
+
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} Hub Device is offline. Hub: ${this.device.hubDeviceId}`);
|
|
179
176
|
break;
|
|
180
177
|
case 190:
|
|
181
178
|
this.errorLog(
|
|
182
|
-
|
|
183
|
-
` with server, Or command: ${
|
|
179
|
+
`${this.device.remoteType}: ${this.accessory.displayName} Device internal error due to device states not synchronized` +
|
|
180
|
+
` with server, Or command: ${superStringify(res)} format is invalid`,
|
|
184
181
|
);
|
|
185
182
|
break;
|
|
186
183
|
case 100:
|
|
187
|
-
this.debugLog(
|
|
184
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Command successfully sent.`);
|
|
188
185
|
break;
|
|
189
186
|
default:
|
|
190
|
-
this.debugLog(
|
|
187
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Unknown statusCode.`);
|
|
191
188
|
}
|
|
192
189
|
}
|
|
193
190
|
|
|
194
191
|
async apiError(e: any): Promise<void> {
|
|
195
192
|
this.switchService.updateCharacteristic(this.platform.Characteristic.On, e);
|
|
196
|
-
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
FirmwareRevision(accessory: PlatformAccessory, device: irdevice & irDevicesConfig): string {
|
|
196
|
+
let FirmwareRevision: string;
|
|
197
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName}`
|
|
198
|
+
+ ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
|
|
199
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
|
|
200
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
|
|
201
|
+
if (accessory.context.FirmwareRevision) {
|
|
202
|
+
FirmwareRevision = accessory.context.FirmwareRevision;
|
|
203
|
+
} else if (device.firmware) {
|
|
204
|
+
FirmwareRevision = device.firmware;
|
|
205
|
+
} else {
|
|
206
|
+
FirmwareRevision = this.platform.version;
|
|
207
|
+
}
|
|
208
|
+
return FirmwareRevision;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
async context() {
|
|
212
|
+
if (this.On === undefined) {
|
|
213
|
+
this.On = false;
|
|
214
|
+
} else {
|
|
215
|
+
this.On = this.accessory.context.On;
|
|
216
|
+
}
|
|
197
217
|
}
|
|
198
218
|
|
|
199
219
|
async config(device: irdevice & irDevicesConfig): Promise<void> {
|
|
@@ -204,24 +224,30 @@ export class VacuumCleaner {
|
|
|
204
224
|
if (device.logging !== undefined) {
|
|
205
225
|
config['logging'] = device.logging;
|
|
206
226
|
}
|
|
227
|
+
if (device.connectionType !== undefined) {
|
|
228
|
+
config['connectionType'] = device.connectionType;
|
|
229
|
+
}
|
|
230
|
+
if (device.external !== undefined) {
|
|
231
|
+
config['external'] = device.external;
|
|
232
|
+
}
|
|
207
233
|
if (Object.entries(config).length !== 0) {
|
|
208
|
-
this.infoLog(
|
|
234
|
+
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
|
|
209
235
|
}
|
|
210
236
|
}
|
|
211
237
|
|
|
212
238
|
async logs(device: irdevice & irDevicesConfig): Promise<void> {
|
|
213
239
|
if (this.platform.debugMode) {
|
|
214
240
|
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
215
|
-
this.debugLog(
|
|
241
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
216
242
|
} else if (device.logging) {
|
|
217
243
|
this.deviceLogging = this.accessory.context.logging = device.logging;
|
|
218
|
-
this.debugLog(
|
|
244
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Config Logging: ${this.deviceLogging}`);
|
|
219
245
|
} else if (this.platform.config.options?.logging) {
|
|
220
246
|
this.deviceLogging = this.accessory.context.logging = this.platform.config.options?.logging;
|
|
221
|
-
this.debugLog(
|
|
247
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Platform Config Logging: ${this.deviceLogging}`);
|
|
222
248
|
} else {
|
|
223
249
|
this.deviceLogging = this.accessory.context.logging = 'standard';
|
|
224
|
-
this.debugLog(
|
|
250
|
+
this.debugLog(`${this.device.remoteType}: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
225
251
|
}
|
|
226
252
|
}
|
|
227
253
|
|
|
@@ -240,12 +266,28 @@ export class VacuumCleaner {
|
|
|
240
266
|
}
|
|
241
267
|
}
|
|
242
268
|
|
|
269
|
+
debugWarnLog(...log: any[]): void {
|
|
270
|
+
if (this.enablingDeviceLogging()) {
|
|
271
|
+
if (this.deviceLogging?.includes('debug')) {
|
|
272
|
+
this.platform.log.warn('[DEBUG]', String(...log));
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
243
277
|
errorLog(...log: any[]): void {
|
|
244
278
|
if (this.enablingDeviceLogging()) {
|
|
245
279
|
this.platform.log.error(String(...log));
|
|
246
280
|
}
|
|
247
281
|
}
|
|
248
282
|
|
|
283
|
+
debugErrorLog(...log: any[]): void {
|
|
284
|
+
if (this.enablingDeviceLogging()) {
|
|
285
|
+
if (this.deviceLogging?.includes('debug')) {
|
|
286
|
+
this.platform.log.error('[DEBUG]', String(...log));
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
249
291
|
debugLog(...log: any[]): void {
|
|
250
292
|
if (this.enablingDeviceLogging()) {
|
|
251
293
|
if (this.deviceLogging === 'debug') {
|