@switchbot/homebridge-switchbot 1.4.0 → 1.4.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.d.ts +1 -1
- package/dist/devices/bots.d.ts.map +1 -1
- package/dist/devices/bots.js +7 -16
- package/dist/devices/bots.js.map +1 -1
- package/dist/devices/colorbulb.d.ts +1 -1
- package/dist/devices/colorbulb.d.ts.map +1 -1
- package/dist/devices/colorbulb.js +8 -12
- package/dist/devices/colorbulb.js.map +1 -1
- package/dist/devices/contact.d.ts +1 -1
- package/dist/devices/contact.d.ts.map +1 -1
- package/dist/devices/contact.js +4 -14
- package/dist/devices/contact.js.map +1 -1
- package/dist/devices/curtains.d.ts +1 -1
- package/dist/devices/curtains.d.ts.map +1 -1
- package/dist/devices/curtains.js +7 -16
- package/dist/devices/curtains.js.map +1 -1
- package/dist/devices/humidifiers.d.ts +1 -1
- package/dist/devices/humidifiers.d.ts.map +1 -1
- package/dist/devices/humidifiers.js +9 -19
- package/dist/devices/humidifiers.js.map +1 -1
- package/dist/devices/indoorcam.d.ts +1 -1
- package/dist/devices/indoorcam.d.ts.map +1 -1
- package/dist/devices/indoorcam.js +5 -5
- package/dist/devices/indoorcam.js.map +1 -1
- package/dist/devices/meters.d.ts +1 -1
- package/dist/devices/meters.d.ts.map +1 -1
- package/dist/devices/meters.js +10 -16
- package/dist/devices/meters.js.map +1 -1
- package/dist/devices/motion.d.ts +1 -1
- package/dist/devices/motion.d.ts.map +1 -1
- package/dist/devices/motion.js +4 -9
- package/dist/devices/motion.js.map +1 -1
- package/dist/devices/plugs.d.ts +1 -1
- package/dist/devices/plugs.d.ts.map +1 -1
- package/dist/devices/plugs.js +4 -4
- package/dist/devices/plugs.js.map +1 -1
- package/dist/irdevices/airconditioners.d.ts +1 -1
- package/dist/irdevices/airconditioners.d.ts.map +1 -1
- package/dist/irdevices/airconditioners.js +3 -8
- package/dist/irdevices/airconditioners.js.map +1 -1
- package/dist/irdevices/airpurifiers.d.ts +1 -1
- package/dist/irdevices/airpurifiers.d.ts.map +1 -1
- package/dist/irdevices/airpurifiers.js +3 -6
- package/dist/irdevices/airpurifiers.js.map +1 -1
- package/dist/irdevices/cameras.d.ts +1 -1
- package/dist/irdevices/cameras.d.ts.map +1 -1
- package/dist/irdevices/cameras.js +3 -3
- package/dist/irdevices/cameras.js.map +1 -1
- package/dist/irdevices/fans.d.ts +1 -1
- package/dist/irdevices/fans.d.ts.map +1 -1
- package/dist/irdevices/fans.js +3 -5
- package/dist/irdevices/fans.js.map +1 -1
- package/dist/irdevices/lights.d.ts +1 -1
- package/dist/irdevices/lights.d.ts.map +1 -1
- package/dist/irdevices/lights.js +3 -3
- package/dist/irdevices/lights.js.map +1 -1
- package/dist/irdevices/others.d.ts +1 -1
- package/dist/irdevices/others.d.ts.map +1 -1
- package/dist/irdevices/others.js +3 -3
- package/dist/irdevices/others.js.map +1 -1
- package/dist/irdevices/tvs.d.ts +1 -1
- package/dist/irdevices/tvs.d.ts.map +1 -1
- package/dist/irdevices/tvs.js +3 -4
- package/dist/irdevices/tvs.js.map +1 -1
- package/dist/irdevices/vacuumcleaners.d.ts +1 -1
- package/dist/irdevices/vacuumcleaners.d.ts.map +1 -1
- package/dist/irdevices/vacuumcleaners.js +3 -3
- package/dist/irdevices/vacuumcleaners.js.map +1 -1
- package/dist/irdevices/waterheaters.d.ts +1 -1
- package/dist/irdevices/waterheaters.d.ts.map +1 -1
- package/dist/irdevices/waterheaters.js +3 -3
- package/dist/irdevices/waterheaters.js.map +1 -1
- package/package.json +66 -66
- package/src/devices/bots.ts +8 -16
- package/src/devices/colorbulb.ts +9 -13
- package/src/devices/contact.ts +5 -15
- package/src/devices/curtains.ts +8 -17
- package/src/devices/humidifiers.ts +10 -20
- package/src/devices/indoorcam.ts +6 -6
- package/src/devices/meters.ts +11 -17
- package/src/devices/motion.ts +5 -10
- package/src/devices/plugs.ts +5 -5
- package/src/irdevices/airconditioners.ts +4 -9
- package/src/irdevices/airpurifiers.ts +4 -7
- package/src/irdevices/cameras.ts +4 -4
- package/src/irdevices/fans.ts +4 -6
- package/src/irdevices/lights.ts +4 -4
- package/src/irdevices/others.ts +4 -4
- package/src/irdevices/tvs.ts +4 -5
- package/src/irdevices/vacuumcleaners.ts +4 -4
- package/src/irdevices/waterheaters.ts +4 -4
package/src/irdevices/fans.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { SwitchBotPlatform } from '../platform';
|
|
3
|
-
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
|
|
3
|
+
import { CharacteristicValue, HAPStatus, PlatformAccessory, Service } from 'homebridge';
|
|
4
4
|
import { DeviceURL, irdevice, deviceStatusResponse, irDevicesConfig, payload } from '../settings';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -252,7 +252,7 @@ export class Fan {
|
|
|
252
252
|
this.platform.log.error(`Fan: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
|
|
253
253
|
+ ` Error: ${JSON.stringify(e)}`);
|
|
254
254
|
}
|
|
255
|
-
this.apiError(
|
|
255
|
+
this.apiError();
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
|
|
@@ -285,9 +285,7 @@ export class Fan {
|
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
public apiError(
|
|
289
|
-
this.
|
|
290
|
-
this.service.updateCharacteristic(this.platform.Characteristic.RotationSpeed, e);
|
|
291
|
-
this.service.updateCharacteristic(this.platform.Characteristic.SwingMode, e);
|
|
288
|
+
public apiError() {
|
|
289
|
+
throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
292
290
|
}
|
|
293
291
|
}
|
package/src/irdevices/lights.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { SwitchBotPlatform } from '../platform';
|
|
3
3
|
import { irDevicesConfig, DeviceURL, irdevice, payload } from '../settings';
|
|
4
|
-
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
|
|
4
|
+
import { CharacteristicValue, HAPStatus, PlatformAccessory, Service } from 'homebridge';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Platform Accessory
|
|
@@ -163,7 +163,7 @@ export class Light {
|
|
|
163
163
|
this.platform.log.error(`Light: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
|
|
164
164
|
+ ` Error: ${JSON.stringify(e)}`);
|
|
165
165
|
}
|
|
166
|
-
this.apiError(
|
|
166
|
+
this.apiError();
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -197,7 +197,7 @@ export class Light {
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
public apiError(
|
|
201
|
-
this.
|
|
200
|
+
public apiError() {
|
|
201
|
+
throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
202
202
|
}
|
|
203
203
|
}
|
package/src/irdevices/others.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { SwitchBotPlatform } from '../platform';
|
|
3
3
|
import { irDevicesConfig, DeviceURL, irdevice, payload } from '../settings';
|
|
4
|
-
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
|
|
4
|
+
import { CharacteristicValue, HAPStatus, PlatformAccessory, Service } from 'homebridge';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Platform Accessory
|
|
@@ -151,7 +151,7 @@ export class Others {
|
|
|
151
151
|
this.platform.log.error(`Other: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
|
|
152
152
|
+ ` Error: ${JSON.stringify(e)}`);
|
|
153
153
|
}
|
|
154
|
-
this.apiError(
|
|
154
|
+
this.apiError();
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
|
|
@@ -184,7 +184,7 @@ export class Others {
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
public apiError(
|
|
188
|
-
this.
|
|
187
|
+
public apiError() {
|
|
188
|
+
throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
189
189
|
}
|
|
190
190
|
}
|
package/src/irdevices/tvs.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { SwitchBotPlatform } from '../platform';
|
|
3
|
-
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
|
|
3
|
+
import { CharacteristicValue, HAPStatus, PlatformAccessory, Service } from 'homebridge';
|
|
4
4
|
import { DeviceURL, irdevice, deviceStatusResponse, irDevicesConfig, payload } from '../settings';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -367,7 +367,7 @@ export class TV {
|
|
|
367
367
|
this.platform.log.error(`${this.device.remoteType}: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
|
|
368
368
|
+ ` Error: ${JSON.stringify(e)}`);
|
|
369
369
|
}
|
|
370
|
-
this.apiError(
|
|
370
|
+
this.apiError();
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
373
|
|
|
@@ -402,8 +402,7 @@ export class TV {
|
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
-
public apiError(
|
|
406
|
-
this.
|
|
407
|
-
this.service.updateCharacteristic(this.platform.Characteristic.ActiveIdentifier, e);
|
|
405
|
+
public apiError() {
|
|
406
|
+
throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
408
407
|
}
|
|
409
408
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { SwitchBotPlatform } from '../platform';
|
|
3
3
|
import { irDevicesConfig, DeviceURL, irdevice, payload } from '../settings';
|
|
4
|
-
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
|
|
4
|
+
import { CharacteristicValue, HAPStatus, PlatformAccessory, Service } from 'homebridge';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Platform Accessory
|
|
@@ -130,7 +130,7 @@ export class VacuumCleaner {
|
|
|
130
130
|
this.platform.log.error(`Vacuum Cleaner: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
|
|
131
131
|
+ ` Error: ${JSON.stringify(e)}`);
|
|
132
132
|
}
|
|
133
|
-
this.apiError(
|
|
133
|
+
this.apiError();
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -163,7 +163,7 @@ export class VacuumCleaner {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
public apiError(
|
|
167
|
-
this.
|
|
166
|
+
public apiError() {
|
|
167
|
+
throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { SwitchBotPlatform } from '../platform';
|
|
3
3
|
import { irDevicesConfig, DeviceURL, irdevice, payload } from '../settings';
|
|
4
|
-
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
|
|
4
|
+
import { CharacteristicValue, HAPStatus, PlatformAccessory, Service } from 'homebridge';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Platform Accessory
|
|
@@ -144,7 +144,7 @@ export class WaterHeater {
|
|
|
144
144
|
this.platform.log.error(`Water Heater: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
|
|
145
145
|
+ ` Error: ${JSON.stringify(e)}`);
|
|
146
146
|
}
|
|
147
|
-
this.apiError(
|
|
147
|
+
this.apiError();
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -177,7 +177,7 @@ export class WaterHeater {
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
public apiError(
|
|
181
|
-
this.
|
|
180
|
+
public apiError() {
|
|
181
|
+
throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
182
182
|
}
|
|
183
183
|
}
|