@switchbot/homebridge-switchbot 1.3.0 → 1.3.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.
- package/dist/devices/bots.js +1 -1
- package/dist/devices/bots.js.map +1 -1
- package/dist/devices/colorbulb.js +1 -1
- package/dist/devices/colorbulb.js.map +1 -1
- package/dist/devices/curtains.js +1 -1
- package/dist/devices/curtains.js.map +1 -1
- package/dist/devices/humidifiers.js +1 -1
- package/dist/devices/humidifiers.js.map +1 -1
- package/dist/devices/indoorcam.d.ts +32 -3
- package/dist/devices/indoorcam.d.ts.map +1 -1
- package/dist/devices/indoorcam.js +92 -45
- package/dist/devices/indoorcam.js.map +1 -1
- package/dist/devices/plugs.js +1 -1
- package/dist/devices/plugs.js.map +1 -1
- package/dist/irdevices/airconditioners.js +1 -1
- package/dist/irdevices/airconditioners.js.map +1 -1
- package/dist/irdevices/airpurifiers.js +1 -1
- package/dist/irdevices/airpurifiers.js.map +1 -1
- package/dist/irdevices/cameras.js +1 -1
- package/dist/irdevices/cameras.js.map +1 -1
- package/dist/irdevices/fans.js +1 -1
- package/dist/irdevices/fans.js.map +1 -1
- package/dist/irdevices/lights.js +1 -1
- package/dist/irdevices/lights.js.map +1 -1
- package/dist/irdevices/others.js +1 -1
- package/dist/irdevices/others.js.map +1 -1
- package/dist/irdevices/tvs.js +1 -1
- package/dist/irdevices/tvs.js.map +1 -1
- package/dist/irdevices/vacuumcleaners.js +1 -1
- package/dist/irdevices/vacuumcleaners.js.map +1 -1
- package/dist/irdevices/waterheaters.js +1 -1
- package/dist/irdevices/waterheaters.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +3 -3
- package/dist/platform.js.map +1 -1
- package/package.json +66 -66
- package/src/devices/bots.ts +1 -1
- package/src/devices/colorbulb.ts +1 -1
- package/src/devices/curtains.ts +1 -1
- package/src/devices/humidifiers.ts +1 -1
- package/src/devices/indoorcam.ts +117 -49
- package/src/devices/plugs.ts +1 -1
- package/src/irdevices/airconditioners.ts +1 -1
- package/src/irdevices/airpurifiers.ts +1 -1
- package/src/irdevices/cameras.ts +1 -1
- package/src/irdevices/fans.ts +1 -1
- package/src/irdevices/lights.ts +1 -1
- package/src/irdevices/others.ts +1 -1
- package/src/irdevices/tvs.ts +1 -1
- package/src/irdevices/vacuumcleaners.ts +1 -1
- package/src/irdevices/waterheaters.ts +1 -1
- package/src/platform.ts +5 -3
|
@@ -630,7 +630,7 @@ export class Humidifier {
|
|
|
630
630
|
this.platform.log.error(`Humidifier: ${this.accessory.displayName} Device is offline.`);
|
|
631
631
|
break;
|
|
632
632
|
case 171:
|
|
633
|
-
this.platform.log.error(`Humidifier: ${this.accessory.displayName} Hub Device is offline
|
|
633
|
+
this.platform.log.error(`Humidifier: ${this.accessory.displayName} Hub Device is offline. Hub: ${this.device.hubDeviceId}`);
|
|
634
634
|
break;
|
|
635
635
|
case 190:
|
|
636
636
|
this.platform.log.error(`Humidifier: ${this.accessory.displayName} Device internal error due to device states not synchronized with server,`
|
package/src/devices/indoorcam.ts
CHANGED
|
@@ -10,8 +10,13 @@ export class IndoorCam {
|
|
|
10
10
|
private service: Service;
|
|
11
11
|
|
|
12
12
|
// Characteristic Values
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
Active!: CharacteristicValue;
|
|
14
|
+
SetupEndpoints!: CharacteristicValue;
|
|
15
|
+
StreamingStatus!: CharacteristicValue;
|
|
16
|
+
SupportedRTPConfiguration!: CharacteristicValue;
|
|
17
|
+
SelectedRTPStreamConfiguration!: CharacteristicValue;
|
|
18
|
+
SupportedVideoStreamConfiguration!: CharacteristicValue;
|
|
19
|
+
SupportedAudioStreamConfiguration!: CharacteristicValue;
|
|
15
20
|
|
|
16
21
|
// OpenAPI Others
|
|
17
22
|
deviceStatus!: deviceStatusResponse;
|
|
@@ -29,9 +34,12 @@ export class IndoorCam {
|
|
|
29
34
|
private accessory: PlatformAccessory,
|
|
30
35
|
public device: device & devicesConfig,
|
|
31
36
|
) {
|
|
37
|
+
// Indoor Cam Config
|
|
38
|
+
this.platform.device(`Indoor Cam: ${this.accessory.displayName} Config: (hide_device: ${device.hide_device})`);
|
|
39
|
+
|
|
40
|
+
this.platform.log.error(`Indoor Cam: ${this.accessory.displayName} was added but will not work as OpenAPI doesn't support it yet.`);
|
|
32
41
|
// default placeholders
|
|
33
|
-
this.
|
|
34
|
-
this.OutletInUse = true;
|
|
42
|
+
this.SelectedRTPStreamConfiguration;
|
|
35
43
|
|
|
36
44
|
// this is subject we use to track when we need to POST changes to the SwitchBot API
|
|
37
45
|
this.doCameraUpdate = new Subject();
|
|
@@ -50,8 +58,8 @@ export class IndoorCam {
|
|
|
50
58
|
// get the WindowCovering service if it exists, otherwise create a new WindowCovering service
|
|
51
59
|
// you can create multiple services for each accessory
|
|
52
60
|
(this.service =
|
|
53
|
-
accessory.getService(this.platform.Service.
|
|
54
|
-
accessory.addService(this.platform.Service.
|
|
61
|
+
accessory.getService(this.platform.Service.CameraRTPStreamManagement) ||
|
|
62
|
+
accessory.addService(this.platform.Service.CameraRTPStreamManagement)), `${accessory.displayName} Indoor Camera`;
|
|
55
63
|
|
|
56
64
|
// To avoid "Cannot add a Service with the same UUID another Service without also defining a unique 'subtype' property." error,
|
|
57
65
|
// when creating multiple services of the same type, you need to use the following syntax to specify a name and subtype id:
|
|
@@ -65,9 +73,26 @@ export class IndoorCam {
|
|
|
65
73
|
// see https://developers.homebridge.io/#/service/WindowCovering
|
|
66
74
|
|
|
67
75
|
// create handlers for required characteristics
|
|
68
|
-
this.service.getCharacteristic(this.platform.Characteristic.
|
|
76
|
+
this.service.getCharacteristic(this.platform.Characteristic.Active)
|
|
77
|
+
.onSet(this.ActiveSet.bind(this));
|
|
78
|
+
|
|
79
|
+
this.service.getCharacteristic(this.platform.Characteristic.SelectedRTPStreamConfiguration)
|
|
80
|
+
.onSet(this.SelectedRTPStreamConfigurationSet.bind(this));
|
|
81
|
+
|
|
82
|
+
this.service.getCharacteristic(this.platform.Characteristic.SetupEndpoints)
|
|
83
|
+
.onSet(this.SetupEndpointsSet.bind(this));
|
|
84
|
+
|
|
85
|
+
this.service.getCharacteristic(this.platform.Characteristic.StreamingStatus)
|
|
86
|
+
.onSet(this.StreamingStatusSet.bind(this));
|
|
69
87
|
|
|
70
|
-
this.service.
|
|
88
|
+
this.service.getCharacteristic(this.platform.Characteristic.SupportedAudioStreamConfiguration)
|
|
89
|
+
.onSet(this.SupportedAudioStreamConfigurationSet.bind(this));
|
|
90
|
+
|
|
91
|
+
this.service.getCharacteristic(this.platform.Characteristic.SupportedRTPConfiguration)
|
|
92
|
+
.onSet(this.SupportedRTPConfigurationSet.bind(this));
|
|
93
|
+
|
|
94
|
+
this.service.getCharacteristic(this.platform.Characteristic.SupportedVideoStreamConfiguration)
|
|
95
|
+
.onSet(this.SupportedVideoStreamConfigurationSet.bind(this));
|
|
71
96
|
|
|
72
97
|
// Update Homekit
|
|
73
98
|
this.updateHomeKitCharacteristics();
|
|
@@ -108,14 +133,7 @@ export class IndoorCam {
|
|
|
108
133
|
}
|
|
109
134
|
|
|
110
135
|
parseStatus() {
|
|
111
|
-
|
|
112
|
-
case 'on':
|
|
113
|
-
this.On = true;
|
|
114
|
-
break;
|
|
115
|
-
default:
|
|
116
|
-
this.On = false;
|
|
117
|
-
}
|
|
118
|
-
this.platform.debug(`Indoor Cam ${this.accessory.displayName} On: ${this.On}`);
|
|
136
|
+
this.platform.debug(`Indoor Cam ${this.accessory.displayName} SelectedRTPStreamConfiguration: ${this.SelectedRTPStreamConfiguration}`);
|
|
119
137
|
}
|
|
120
138
|
|
|
121
139
|
|
|
@@ -146,45 +164,37 @@ export class IndoorCam {
|
|
|
146
164
|
* Camera - "command" "turnOn" "default" = set to ON state
|
|
147
165
|
*/
|
|
148
166
|
async pushChanges() {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
167
|
+
if (!this.Active) {
|
|
168
|
+
const payload = {
|
|
169
|
+
commandType: 'command',
|
|
170
|
+
parameter: 'default',
|
|
171
|
+
command: 'turnOn',
|
|
172
|
+
} as payload;
|
|
173
|
+
|
|
174
|
+
this.platform.log.info(`Indoor Cam: ${this.accessory.displayName} Sending request to SwitchBot API. command: ${payload.command},`
|
|
175
|
+
+ ` parameter: ${payload.parameter}, commandType: ${payload.commandType}`);
|
|
176
|
+
|
|
177
|
+
// Make the API request
|
|
178
|
+
const push: any = await this.platform.axios.post(`${DeviceURL}/${this.device.deviceId}/commands`, payload);
|
|
179
|
+
this.platform.debug(`Indoor Cam: ${this.accessory.displayName} pushChanges: ${JSON.stringify(push.data)}`);
|
|
180
|
+
this.statusCode(push);
|
|
181
|
+
this.refreshStatus();
|
|
156
182
|
} else {
|
|
157
|
-
|
|
183
|
+
this.platform.device(`Indoor Cam: ${this.accessory.displayName} No pushChanges. Active: ${this.Active}`);
|
|
158
184
|
}
|
|
159
|
-
|
|
160
|
-
this.platform.log.info(`Indoor Cam: ${this.accessory.displayName} Sending request to SwitchBot API. command: ${payload.command},`
|
|
161
|
-
+ ` parameter: ${payload.parameter}, commandType: ${payload.commandType}`);
|
|
162
|
-
|
|
163
|
-
// Make the API request
|
|
164
|
-
const push: any = await this.platform.axios.post(`${DeviceURL}/${this.device.deviceId}/commands`, payload);
|
|
165
|
-
this.platform.debug(`Indoor Cam: ${this.accessory.displayName} pushChanges: ${JSON.stringify(push.data)}`);
|
|
166
|
-
this.statusCode(push);
|
|
167
|
-
this.refreshStatus();
|
|
168
185
|
}
|
|
169
186
|
|
|
170
187
|
updateHomeKitCharacteristics() {
|
|
171
|
-
if (this.
|
|
172
|
-
this.platform.debug(`Indoor Cam: ${this.accessory.displayName} On: ${this.
|
|
188
|
+
if (this.SelectedRTPStreamConfiguration === undefined) {
|
|
189
|
+
this.platform.debug(`Indoor Cam: ${this.accessory.displayName} On: ${this.SelectedRTPStreamConfiguration}`);
|
|
173
190
|
} else {
|
|
174
|
-
this.service.updateCharacteristic(this.platform.Characteristic.
|
|
175
|
-
this.platform.device(`Indoor Cam: ${this.accessory.displayName} updateCharacteristic On: ${this.
|
|
176
|
-
}
|
|
177
|
-
if (this.OutletInUse === undefined) {
|
|
178
|
-
this.platform.debug(`Indoor Cam: ${this.accessory.displayName} OutletInUse: ${this.OutletInUse}`);
|
|
179
|
-
} else {
|
|
180
|
-
this.service.updateCharacteristic(this.platform.Characteristic.OutletInUse, this.OutletInUse);
|
|
181
|
-
this.platform.device(`Indoor Cam: ${this.accessory.displayName} updateCharacteristic OutletInUse: ${this.OutletInUse}`);
|
|
191
|
+
this.service.updateCharacteristic(this.platform.Characteristic.SelectedRTPStreamConfiguration, this.SelectedRTPStreamConfiguration);
|
|
192
|
+
this.platform.device(`Indoor Cam: ${this.accessory.displayName} updateCharacteristic On: ${this.SelectedRTPStreamConfiguration}`);
|
|
182
193
|
}
|
|
183
194
|
}
|
|
184
195
|
|
|
185
196
|
public apiError(e: any) {
|
|
186
|
-
this.service.updateCharacteristic(this.platform.Characteristic.
|
|
187
|
-
this.service.updateCharacteristic(this.platform.Characteristic.OutletInUse, e);
|
|
197
|
+
this.service.updateCharacteristic(this.platform.Characteristic.SelectedRTPStreamConfiguration, e);
|
|
188
198
|
}
|
|
189
199
|
|
|
190
200
|
private statusCode(push: AxiosResponse<{ statusCode: number; }>) {
|
|
@@ -202,7 +212,7 @@ export class IndoorCam {
|
|
|
202
212
|
this.platform.log.error(`Indoor Cam: ${this.accessory.displayName} Device is offline.`);
|
|
203
213
|
break;
|
|
204
214
|
case 171:
|
|
205
|
-
this.platform.log.error(`Indoor Cam: ${this.accessory.displayName} Hub Device is offline
|
|
215
|
+
this.platform.log.error(`Indoor Cam: ${this.accessory.displayName} Hub Device is offline. Hub: ${this.device.hubDeviceId}`);
|
|
206
216
|
break;
|
|
207
217
|
case 190:
|
|
208
218
|
this.platform.log.error(`Indoor Cam: ${this.accessory.displayName} Device internal error due to device states not synchronized with server,`
|
|
@@ -216,15 +226,73 @@ export class IndoorCam {
|
|
|
216
226
|
}
|
|
217
227
|
}
|
|
218
228
|
|
|
229
|
+
/**
|
|
230
|
+
* Handle requests to set the value of the "Active" characteristic
|
|
231
|
+
*/
|
|
232
|
+
ActiveSet(value: CharacteristicValue) {
|
|
233
|
+
this.platform.debug(`Indoor Cam: ${this.accessory.displayName} Active: ${value}`);
|
|
234
|
+
|
|
235
|
+
this.Active = value;
|
|
236
|
+
this.doCameraUpdate.next();
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Handle requests to set the value of the "SelectedRTPStreamConfiguration" characteristic
|
|
241
|
+
*/
|
|
242
|
+
SelectedRTPStreamConfigurationSet(value: CharacteristicValue) {
|
|
243
|
+
this.platform.debug(`Indoor Cam: ${this.accessory.displayName} SelectedRTPStreamConfiguration: ${value}`);
|
|
244
|
+
|
|
245
|
+
this.SelectedRTPStreamConfiguration = value;
|
|
246
|
+
this.doCameraUpdate.next();
|
|
247
|
+
}
|
|
248
|
+
|
|
219
249
|
/**
|
|
220
250
|
* Handle requests to set the value of the "On" characteristic
|
|
221
251
|
*/
|
|
222
|
-
|
|
223
|
-
this.platform.debug(`Indoor Cam: ${this.accessory.displayName}
|
|
252
|
+
SetupEndpointsSet(value: CharacteristicValue) {
|
|
253
|
+
this.platform.debug(`Indoor Cam: ${this.accessory.displayName} SetupEndpoints: ${value}`);
|
|
224
254
|
|
|
225
|
-
this.
|
|
255
|
+
this.SetupEndpoints = value;
|
|
226
256
|
this.doCameraUpdate.next();
|
|
227
257
|
}
|
|
228
258
|
|
|
259
|
+
/**
|
|
260
|
+
* Handle requests to set the value of the "On" characteristic
|
|
261
|
+
*/
|
|
262
|
+
SupportedAudioStreamConfigurationSet(value: CharacteristicValue) {
|
|
263
|
+
this.platform.debug(`Indoor Cam: ${this.accessory.displayName} SupportedAudioStreamConfiguration: ${value}`);
|
|
264
|
+
|
|
265
|
+
this.SupportedAudioStreamConfiguration = value;
|
|
266
|
+
this.doCameraUpdate.next();
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Handle requests to set the value of the "On" characteristic
|
|
271
|
+
*/
|
|
272
|
+
SupportedRTPConfigurationSet(value: CharacteristicValue) {
|
|
273
|
+
this.platform.debug(`Indoor Cam: ${this.accessory.displayName} SupportedRTPConfiguration: ${value}`);
|
|
274
|
+
|
|
275
|
+
this.SupportedRTPConfiguration = value;
|
|
276
|
+
this.doCameraUpdate.next();
|
|
277
|
+
}
|
|
229
278
|
|
|
279
|
+
/**
|
|
280
|
+
* Handle requests to set the value of the "On" characteristic
|
|
281
|
+
*/
|
|
282
|
+
StreamingStatusSet(value: CharacteristicValue) {
|
|
283
|
+
this.platform.debug(`Indoor Cam: ${this.accessory.displayName} StreamingStatus: ${value}`);
|
|
284
|
+
|
|
285
|
+
this.StreamingStatus = value;
|
|
286
|
+
this.doCameraUpdate.next();
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Handle requests to set the value of the "On" characteristic
|
|
291
|
+
*/
|
|
292
|
+
SupportedVideoStreamConfigurationSet(value: CharacteristicValue) {
|
|
293
|
+
this.platform.debug(`Indoor Cam: ${this.accessory.displayName} SupportedVideoStreamConfiguration: ${value}`);
|
|
294
|
+
|
|
295
|
+
this.SupportedVideoStreamConfiguration = value;
|
|
296
|
+
this.doCameraUpdate.next();
|
|
297
|
+
}
|
|
230
298
|
}
|
package/src/devices/plugs.ts
CHANGED
|
@@ -190,7 +190,7 @@ export class Plug {
|
|
|
190
190
|
this.platform.log.error(`Plug: ${this.accessory.displayName} Device is offline.`);
|
|
191
191
|
break;
|
|
192
192
|
case 171:
|
|
193
|
-
this.platform.log.error(`Plug: ${this.accessory.displayName} Hub Device is offline
|
|
193
|
+
this.platform.log.error(`Plug: ${this.accessory.displayName} Hub Device is offline. Hub: ${this.device.hubDeviceId}`);
|
|
194
194
|
break;
|
|
195
195
|
case 190:
|
|
196
196
|
this.platform.log.error(`Plug: ${this.accessory.displayName} Device internal error due to device states not synchronized with server,`
|
|
@@ -379,7 +379,7 @@ export class AirConditioner {
|
|
|
379
379
|
this.platform.log.error(`Air Conditioner: ${this.accessory.displayName} Device is offline.`);
|
|
380
380
|
break;
|
|
381
381
|
case 171:
|
|
382
|
-
this.platform.log.error(`Air Conditioner: ${this.accessory.displayName} Hub Device is offline
|
|
382
|
+
this.platform.log.error(`Air Conditioner: ${this.accessory.displayName} Hub Device is offline. Hub: ${this.device.hubDeviceId}`);
|
|
383
383
|
break;
|
|
384
384
|
case 190:
|
|
385
385
|
this.platform.log.error(`Air Conditioner: ${this.accessory.displayName} Device internal error due to device states not synchronized`
|
|
@@ -239,7 +239,7 @@ export class AirPurifier {
|
|
|
239
239
|
this.platform.log.error(`Air Purifier: ${this.accessory.displayName} Device is offline.`);
|
|
240
240
|
break;
|
|
241
241
|
case 171:
|
|
242
|
-
this.platform.log.error(`Air Purifier: ${this.accessory.displayName} Hub Device is offline
|
|
242
|
+
this.platform.log.error(`Air Purifier: ${this.accessory.displayName} Hub Device is offline. Hub: ${this.device.hubDeviceId}`);
|
|
243
243
|
break;
|
|
244
244
|
case 190:
|
|
245
245
|
this.platform.log.error(`Air Purifier: ${this.accessory.displayName} Device internal error due to device states not synchronized`
|
package/src/irdevices/cameras.ts
CHANGED
|
@@ -139,7 +139,7 @@ export class Camera {
|
|
|
139
139
|
this.platform.log.error(`Camera: ${this.accessory.displayName} Device is offline.`);
|
|
140
140
|
break;
|
|
141
141
|
case 171:
|
|
142
|
-
this.platform.log.error(`Camera: ${this.accessory.displayName} Hub Device is offline
|
|
142
|
+
this.platform.log.error(`Camera: ${this.accessory.displayName} Hub Device is offline. Hub: ${this.device.hubDeviceId}`);
|
|
143
143
|
break;
|
|
144
144
|
case 190:
|
|
145
145
|
this.platform.log.error(`Camera: ${this.accessory.displayName} Device internal error due to device states not synchronized`
|
package/src/irdevices/fans.ts
CHANGED
|
@@ -261,7 +261,7 @@ export class Fan {
|
|
|
261
261
|
this.platform.log.error(`Fan: ${this.accessory.displayName} Device is offline.`);
|
|
262
262
|
break;
|
|
263
263
|
case 171:
|
|
264
|
-
this.platform.log.error(`Fan: ${this.accessory.displayName} Hub Device is offline
|
|
264
|
+
this.platform.log.error(`Fan: ${this.accessory.displayName} Hub Device is offline. Hub: ${this.device.hubDeviceId}`);
|
|
265
265
|
break;
|
|
266
266
|
case 190:
|
|
267
267
|
this.platform.log.error(`Fan: ${this.accessory.displayName} Device internal error due to device states not synchronized`
|
package/src/irdevices/lights.ts
CHANGED
|
@@ -173,7 +173,7 @@ export class Light {
|
|
|
173
173
|
this.platform.log.error(`Light: ${this.accessory.displayName} Device is offline.`);
|
|
174
174
|
break;
|
|
175
175
|
case 171:
|
|
176
|
-
this.platform.log.error(`Light: ${this.accessory.displayName} Hub Device is offline
|
|
176
|
+
this.platform.log.error(`Light: ${this.accessory.displayName} Hub Device is offline. Hub: ${this.device.hubDeviceId}`);
|
|
177
177
|
break;
|
|
178
178
|
case 190:
|
|
179
179
|
this.platform.log.error(`Light: ${this.accessory.displayName} Device internal error due to device states not synchronized`
|
package/src/irdevices/others.ts
CHANGED
|
@@ -160,7 +160,7 @@ export class Others {
|
|
|
160
160
|
this.platform.log.error(`Other: ${this.accessory.displayName} Device is offline.`);
|
|
161
161
|
break;
|
|
162
162
|
case 171:
|
|
163
|
-
this.platform.log.error(`Other: ${this.accessory.displayName} Hub Device is offline
|
|
163
|
+
this.platform.log.error(`Other: ${this.accessory.displayName} Hub Device is offline. Hub: ${this.device.hubDeviceId}`);
|
|
164
164
|
break;
|
|
165
165
|
case 190:
|
|
166
166
|
this.platform.log.error(`Other: ${this.accessory.displayName} Device internal error due to device states not synchronized`
|
package/src/irdevices/tvs.ts
CHANGED
|
@@ -377,7 +377,7 @@ export class TV {
|
|
|
377
377
|
this.platform.log.error(`${this.device.remoteType}: ${this.accessory.displayName} Device is offline.`);
|
|
378
378
|
break;
|
|
379
379
|
case 171:
|
|
380
|
-
this.platform.log.error(`${this.device.remoteType}: ${this.accessory.displayName} Hub Device is offline
|
|
380
|
+
this.platform.log.error(`${this.device.remoteType}: ${this.accessory.displayName} Hub Device is offline. Hub: ${this.device.hubDeviceId}`);
|
|
381
381
|
break;
|
|
382
382
|
case 190:
|
|
383
383
|
this.platform.log.error(`${this.device.remoteType}: `
|
|
@@ -139,7 +139,7 @@ export class VacuumCleaner {
|
|
|
139
139
|
this.platform.log.error(`Vacuum Cleaner: ${this.accessory.displayName} Device is offline.`);
|
|
140
140
|
break;
|
|
141
141
|
case 171:
|
|
142
|
-
this.platform.log.error(`Vacuum Cleaner: ${this.accessory.displayName} Hub Device is offline
|
|
142
|
+
this.platform.log.error(`Vacuum Cleaner: ${this.accessory.displayName} Hub Device is offline. Hub: ${this.device.hubDeviceId}`);
|
|
143
143
|
break;
|
|
144
144
|
case 190:
|
|
145
145
|
this.platform.log.error(`Vacuum Cleaner: ${this.accessory.displayName} Device internal error due to device states not synchronized`
|
|
@@ -153,7 +153,7 @@ export class WaterHeater {
|
|
|
153
153
|
this.platform.log.error(`Water Heater: ${this.accessory.displayName} Device is offline.`);
|
|
154
154
|
break;
|
|
155
155
|
case 171:
|
|
156
|
-
this.platform.log.error(`Water Heater: ${this.accessory.displayName} Hub Device is offline
|
|
156
|
+
this.platform.log.error(`Water Heater: ${this.accessory.displayName} Hub Device is offline. Hub: ${this.device.hubDeviceId}`);
|
|
157
157
|
break;
|
|
158
158
|
case 190:
|
|
159
159
|
this.platform.log.error(`Water Heater: ${this.accessory.displayName} Device internal error due to device states not synchronized`
|
package/src/platform.ts
CHANGED
|
@@ -204,7 +204,8 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
204
204
|
|
|
205
205
|
const mergeBydeviceId = (a1: { deviceId: string; }[], a2: any[]) =>
|
|
206
206
|
a1.map((itm: { deviceId: string; }) => ({
|
|
207
|
-
...a2.find((item: { deviceId: string; }) => (
|
|
207
|
+
...a2.find((item: { deviceId: string; }) => (
|
|
208
|
+
item.deviceId.toUpperCase().replace(/[^A-Z0-9]+/g, '') === itm.deviceId.toUpperCase().replace(/[^A-Z0-9]+/g, '')) && item),
|
|
208
209
|
...itm,
|
|
209
210
|
}));
|
|
210
211
|
|
|
@@ -238,7 +239,8 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
238
239
|
|
|
239
240
|
const mergeIRBydeviceId = (a1: { deviceId: string; }[], a2: any[]) =>
|
|
240
241
|
a1.map((itm: { deviceId: string; }) => ({
|
|
241
|
-
...a2.find((item: { deviceId: string; }) => (
|
|
242
|
+
...a2.find((item: { deviceId: string; }) => (
|
|
243
|
+
item.deviceId.toUpperCase().replace(/[^A-Z0-9]+/g, '') === itm.deviceId.toUpperCase().replace(/[^A-Z0-9]+/g, '')) && item),
|
|
242
244
|
...itm,
|
|
243
245
|
}));
|
|
244
246
|
|
|
@@ -310,7 +312,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
310
312
|
this.debug(`Discovered ${device.deviceType}: ${device.deviceId}`);
|
|
311
313
|
this.createColorBulb(device);
|
|
312
314
|
break;
|
|
313
|
-
case '
|
|
315
|
+
case 'Indoor Cam':
|
|
314
316
|
this.debug(`Discovered ${device.deviceType}: ${device.deviceId}`);
|
|
315
317
|
this.createIndoorCam(device);
|
|
316
318
|
break;
|