@switchbot/homebridge-switchbot 1.4.1-beta.4 → 1.5.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/.github/FUNDING.yml +4 -0
- package/CHANGELOG.md +3 -3
- package/dist/devices/bots.d.ts +1 -1
- package/dist/devices/bots.d.ts.map +1 -1
- package/dist/devices/bots.js +17 -17
- 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 +13 -8
- 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 +15 -4
- 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 +17 -7
- 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 +20 -9
- package/dist/devices/humidifiers.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 +12 -4
- 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 +10 -4
- 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 +5 -4
- package/dist/devices/plugs.js.map +1 -1
- package/dist/irdevices/airconditioners.d.ts +30 -15
- package/dist/irdevices/airconditioners.d.ts.map +1 -1
- package/dist/irdevices/airconditioners.js +308 -165
- 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 +7 -3
- 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 +4 -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 +6 -3
- 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 +4 -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 +4 -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 +5 -3
- 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 +4 -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 +4 -3
- package/dist/irdevices/waterheaters.js.map +1 -1
- package/package.json +68 -68
- package/src/devices/bots.ts +17 -18
- package/src/devices/colorbulb.ts +14 -9
- package/src/devices/contact.ts +16 -5
- package/src/devices/curtains.ts +17 -7
- package/src/devices/humidifiers.ts +21 -10
- package/src/devices/meters.ts +13 -5
- package/src/devices/motion.ts +11 -5
- package/src/devices/plugs.ts +6 -5
- package/src/irdevices/airconditioners.ts +309 -165
- package/src/irdevices/airpurifiers.ts +8 -4
- package/src/irdevices/cameras.ts +5 -4
- package/src/irdevices/fans.ts +7 -4
- package/src/irdevices/lights.ts +5 -4
- package/src/irdevices/others.ts +4 -3
- package/src/irdevices/tvs.ts +6 -4
- package/src/irdevices/vacuumcleaners.ts +5 -4
- package/src/irdevices/waterheaters.ts +5 -4
package/src/irdevices/cameras.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,
|
|
4
|
+
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Platform Accessory
|
|
@@ -140,7 +140,7 @@ export class Camera {
|
|
|
140
140
|
this.errorLog(`Camera: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
|
|
141
141
|
+ ` Error: ${JSON.stringify(e)}`);
|
|
142
142
|
}
|
|
143
|
-
this.apiError();
|
|
143
|
+
this.apiError(e);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -173,8 +173,9 @@ export class Camera {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
public apiError() {
|
|
177
|
-
|
|
176
|
+
public apiError(e: any) {
|
|
177
|
+
this.service.updateCharacteristic(this.platform.Characteristic.On, e);
|
|
178
|
+
//throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
178
179
|
}
|
|
179
180
|
|
|
180
181
|
/**
|
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,
|
|
3
|
+
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
|
|
4
4
|
import { DeviceURL, irdevice, deviceStatusResponse, irDevicesConfig, payload } from '../settings';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -262,7 +262,7 @@ export class Fan {
|
|
|
262
262
|
this.errorLog(`Fan: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
|
|
263
263
|
+ ` Error: ${JSON.stringify(e)}`);
|
|
264
264
|
}
|
|
265
|
-
this.apiError();
|
|
265
|
+
this.apiError(e);
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
|
|
@@ -295,8 +295,11 @@ export class Fan {
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
public apiError() {
|
|
299
|
-
|
|
298
|
+
public apiError(e: any) {
|
|
299
|
+
this.service.updateCharacteristic(this.platform.Characteristic.Active, e);
|
|
300
|
+
this.service.updateCharacteristic(this.platform.Characteristic.RotationSpeed, e);
|
|
301
|
+
this.service.updateCharacteristic(this.platform.Characteristic.SwingMode, e);
|
|
302
|
+
//throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
300
303
|
}
|
|
301
304
|
|
|
302
305
|
/**
|
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,
|
|
4
|
+
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Platform Accessory
|
|
@@ -173,7 +173,7 @@ export class Light {
|
|
|
173
173
|
this.errorLog(`Light: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
|
|
174
174
|
+ ` Error: ${JSON.stringify(e)}`);
|
|
175
175
|
}
|
|
176
|
-
this.apiError();
|
|
176
|
+
this.apiError(e);
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
@@ -207,8 +207,9 @@ export class Light {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
public apiError() {
|
|
211
|
-
|
|
210
|
+
public apiError(e: any) {
|
|
211
|
+
this.service.updateCharacteristic(this.platform.Characteristic.On, e);
|
|
212
|
+
//throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
212
213
|
}
|
|
213
214
|
|
|
214
215
|
/**
|
package/src/irdevices/others.ts
CHANGED
|
@@ -161,7 +161,7 @@ export class Others {
|
|
|
161
161
|
this.errorLog(`Other: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
|
|
162
162
|
+ ` Error: ${JSON.stringify(e)}`);
|
|
163
163
|
}
|
|
164
|
-
this.apiError();
|
|
164
|
+
this.apiError(e);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
@@ -194,8 +194,9 @@ export class Others {
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
public apiError() {
|
|
198
|
-
|
|
197
|
+
public apiError(e: any) {
|
|
198
|
+
this.service?.updateCharacteristic(this.platform.Characteristic.Active, e);
|
|
199
|
+
//throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
199
200
|
}
|
|
200
201
|
|
|
201
202
|
/**
|
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,
|
|
3
|
+
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
|
|
4
4
|
import { DeviceURL, irdevice, deviceStatusResponse, irDevicesConfig, payload } from '../settings';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -377,7 +377,7 @@ export class TV {
|
|
|
377
377
|
this.errorLog(`${this.device.remoteType}: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
|
|
378
378
|
+ ` Error: ${JSON.stringify(e)}`);
|
|
379
379
|
}
|
|
380
|
-
this.apiError();
|
|
380
|
+
this.apiError(e);
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
|
|
@@ -412,8 +412,10 @@ export class TV {
|
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
|
|
415
|
-
public apiError() {
|
|
416
|
-
|
|
415
|
+
public apiError(e: any) {
|
|
416
|
+
this.service.updateCharacteristic(this.platform.Characteristic.Active, e);
|
|
417
|
+
this.service.updateCharacteristic(this.platform.Characteristic.ActiveIdentifier, e);
|
|
418
|
+
//throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
417
419
|
}
|
|
418
420
|
|
|
419
421
|
/**
|
|
@@ -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,
|
|
4
|
+
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Platform Accessory
|
|
@@ -140,7 +140,7 @@ export class VacuumCleaner {
|
|
|
140
140
|
this.errorLog(`Vacuum Cleaner: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
|
|
141
141
|
+ ` Error: ${JSON.stringify(e)}`);
|
|
142
142
|
}
|
|
143
|
-
this.apiError();
|
|
143
|
+
this.apiError(e);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -173,8 +173,9 @@ export class VacuumCleaner {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
public apiError() {
|
|
177
|
-
|
|
176
|
+
public apiError(e: any) {
|
|
177
|
+
this.service.updateCharacteristic(this.platform.Characteristic.On, e);
|
|
178
|
+
//throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
178
179
|
}
|
|
179
180
|
|
|
180
181
|
/**
|
|
@@ -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,
|
|
4
|
+
import { CharacteristicValue, PlatformAccessory, Service } from 'homebridge';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Platform Accessory
|
|
@@ -154,7 +154,7 @@ export class WaterHeater {
|
|
|
154
154
|
this.errorLog(`Water Heater: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,`
|
|
155
155
|
+ ` Error: ${JSON.stringify(e)}`);
|
|
156
156
|
}
|
|
157
|
-
this.apiError();
|
|
157
|
+
this.apiError(e);
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
@@ -187,8 +187,9 @@ export class WaterHeater {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
public apiError() {
|
|
191
|
-
|
|
190
|
+
public apiError(e: any) {
|
|
191
|
+
this.service.updateCharacteristic(this.platform.Characteristic.Active, e);
|
|
192
|
+
//throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
192
193
|
}
|
|
193
194
|
|
|
194
195
|
/**
|