@switchbot/homebridge-switchbot 3.8.3-beta.2 → 3.8.3-beta.21
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/workflows/beta-release.yml +2 -1
- package/CHANGELOG.md +8 -0
- package/dist/device/blindtilt.d.ts +1 -4
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +18 -19
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts +1 -4
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +15 -16
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts +1 -4
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +35 -39
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts +1 -4
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +35 -39
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts +1 -4
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +7 -7
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +1 -4
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +16 -17
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/device.d.ts +6 -6
- package/dist/device/device.d.ts.map +1 -1
- package/dist/device/device.js +30 -14
- package/dist/device/device.js.map +1 -1
- package/dist/device/fan.d.ts +1 -4
- package/dist/device/fan.d.ts.map +1 -1
- package/dist/device/fan.js +28 -31
- package/dist/device/fan.js.map +1 -1
- package/dist/device/hub.d.ts +1 -4
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +7 -7
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts +1 -4
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +28 -31
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts +1 -4
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +7 -7
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts +1 -4
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +28 -31
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts +1 -4
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +15 -16
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts +1 -4
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +7 -7
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts +1 -4
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +7 -7
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts +1 -4
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +7 -7
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts +1 -4
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +14 -15
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts +1 -4
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +21 -23
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/waterdetector.d.ts +1 -4
- package/dist/device/waterdetector.d.ts.map +1 -1
- package/dist/device/waterdetector.js +7 -7
- package/dist/device/waterdetector.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +1 -1
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +11 -12
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts +1 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +11 -12
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts +1 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +9 -10
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts +1 -1
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +15 -16
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/irdevice.d.ts +6 -6
- package/dist/irdevice/irdevice.d.ts.map +1 -1
- package/dist/irdevice/irdevice.js +7 -13
- package/dist/irdevice/irdevice.js.map +1 -1
- package/dist/irdevice/light.d.ts +1 -1
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +9 -10
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +9 -10
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +27 -28
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +9 -10
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts +1 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +9 -10
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts +5 -14
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +53 -161
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +1 -3
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +9 -10
- package/src/device/blindtilt.ts +20 -24
- package/src/device/bot.ts +16 -20
- package/src/device/ceilinglight.ts +36 -43
- package/src/device/colorbulb.ts +36 -43
- package/src/device/contact.ts +8 -11
- package/src/device/curtain.ts +18 -22
- package/src/device/device.ts +29 -18
- package/src/device/fan.ts +29 -35
- package/src/device/hub.ts +8 -11
- package/src/device/humidifier.ts +29 -35
- package/src/device/iosensor.ts +8 -11
- package/src/device/lightstrip.ts +29 -35
- package/src/device/lock.ts +16 -20
- package/src/device/meter.ts +8 -11
- package/src/device/meterplus.ts +8 -11
- package/src/device/motion.ts +8 -11
- package/src/device/plug.ts +15 -19
- package/src/device/robotvacuumcleaner.ts +22 -31
- package/src/device/waterdetector.ts +8 -11
- package/src/irdevice/airconditioner.ts +12 -14
- package/src/irdevice/airpurifier.ts +12 -13
- package/src/irdevice/camera.ts +10 -11
- package/src/irdevice/fan.ts +16 -17
- package/src/irdevice/irdevice.ts +9 -17
- package/src/irdevice/light.ts +10 -11
- package/src/irdevice/other.ts +10 -11
- package/src/irdevice/tv.ts +28 -29
- package/src/irdevice/vacuumcleaner.ts +10 -11
- package/src/irdevice/waterheater.ts +10 -11
- package/src/platform.ts +55 -161
- package/src/settings.ts +1 -4
- package/src/utils.ts +2 -1
- package/dist/types/bledevicestatus.d.ts +0 -281
- package/dist/types/bledevicestatus.d.ts.map +0 -1
- package/dist/types/bledevicestatus.js +0 -2
- package/dist/types/bledevicestatus.js.map +0 -1
- package/dist/types/devicelist.d.ts +0 -89
- package/dist/types/devicelist.d.ts.map +0 -1
- package/dist/types/devicelist.js +0 -6
- package/dist/types/devicelist.js.map +0 -1
- package/dist/types/deviceresponse.d.ts +0 -13
- package/dist/types/deviceresponse.d.ts.map +0 -1
- package/dist/types/deviceresponse.js +0 -2
- package/dist/types/deviceresponse.js.map +0 -1
- package/dist/types/devicestatus.d.ts +0 -149
- package/dist/types/devicestatus.d.ts.map +0 -1
- package/dist/types/devicestatus.js +0 -3
- package/dist/types/devicestatus.js.map +0 -1
- package/dist/types/devicewebhookstatus.d.ts +0 -156
- package/dist/types/devicewebhookstatus.d.ts.map +0 -1
- package/dist/types/devicewebhookstatus.js +0 -2
- package/dist/types/devicewebhookstatus.js.map +0 -1
- package/dist/types/irdevicelist.d.ts +0 -10
- package/dist/types/irdevicelist.d.ts.map +0 -1
- package/dist/types/irdevicelist.js +0 -2
- package/dist/types/irdevicelist.js.map +0 -1
- package/dist/types/pushbody.d.ts +0 -6
- package/dist/types/pushbody.d.ts.map +0 -1
- package/dist/types/pushbody.js +0 -2
- package/dist/types/pushbody.js.map +0 -1
- package/src/types/bledevicestatus.ts +0 -303
- package/src/types/devicelist.ts +0 -124
- package/src/types/deviceresponse.ts +0 -14
- package/src/types/devicestatus.ts +0 -178
- package/src/types/devicewebhookstatus.ts +0 -191
- package/src/types/irdevicelist.ts +0 -15
- package/src/types/pushbody.ts +0 -9
|
@@ -3,17 +3,10 @@
|
|
|
3
3
|
* robotvacuumcleaner.ts: @switchbot/homebridge-switchbot.
|
|
4
4
|
*/
|
|
5
5
|
import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'
|
|
6
|
+
import type { bodyChange, device, floorCleaningRobotS10Status, floorCleaningRobotS10WebhookContext, robotVacuumCleanerS1PlusStatus, robotVacuumCleanerS1PlusWebhookContext, robotVacuumCleanerS1Status, robotVacuumCleanerS1WebhookContext, robotVacuumCleanerServiceData } from 'node-switchbot'
|
|
6
7
|
|
|
7
8
|
import type { SwitchBotPlatform } from '../platform.js'
|
|
8
9
|
import type { devicesConfig } from '../settings.js'
|
|
9
|
-
import type { robotVacuumCleanerServiceData } from '../types/bledevicestatus.js'
|
|
10
|
-
import type { device } from '../types/devicelist.js'
|
|
11
|
-
import type { floorCleaningRobotS10Status, robotVacuumCleanerS1PlusStatus, robotVacuumCleanerS1Status } from '../types/devicestatus.js'
|
|
12
|
-
import type {
|
|
13
|
-
floorCleaningRobotS10WebhookContext,
|
|
14
|
-
robotVacuumCleanerS1PlusWebhookContext,
|
|
15
|
-
robotVacuumCleanerS1WebhookContext,
|
|
16
|
-
} from '../types/devicewebhookstatus.js'
|
|
17
10
|
|
|
18
11
|
/*
|
|
19
12
|
* For Testing Locally:
|
|
@@ -321,17 +314,17 @@ export class RobotVacuumCleaner extends deviceBase {
|
|
|
321
314
|
async openAPIRefreshStatus(): Promise<void> {
|
|
322
315
|
await this.debugLog('openAPIRefreshStatus')
|
|
323
316
|
try {
|
|
324
|
-
const { body
|
|
325
|
-
const deviceStatus: any = await body
|
|
326
|
-
await this.debugLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
327
|
-
if (await this.successfulStatusCodes(
|
|
328
|
-
await this.debugSuccessLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
317
|
+
const { body } = await this.deviceRefreshStatus()
|
|
318
|
+
const deviceStatus: any = await body
|
|
319
|
+
await this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
320
|
+
if (await this.successfulStatusCodes(deviceStatus)) {
|
|
321
|
+
await this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
329
322
|
this.deviceStatus = deviceStatus.body
|
|
330
323
|
await this.openAPIparseStatus()
|
|
331
324
|
await this.updateHomeKitCharacteristics()
|
|
332
325
|
} else {
|
|
333
|
-
await this.debugWarnLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
334
|
-
await this.debugWarnLog(
|
|
326
|
+
await this.debugWarnLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
327
|
+
await this.debugWarnLog(deviceStatus)
|
|
335
328
|
}
|
|
336
329
|
} catch (e: any) {
|
|
337
330
|
await this.apiError(e)
|
|
@@ -434,21 +427,20 @@ export class RobotVacuumCleaner extends deviceBase {
|
|
|
434
427
|
await this.debugLog('openAPIpushChanges')
|
|
435
428
|
if (this.LightBulb.On !== this.accessory.context.On) {
|
|
436
429
|
const command = this.LightBulb.On ? 'start' : 'dock'
|
|
437
|
-
const bodyChange =
|
|
430
|
+
const bodyChange: bodyChange = {
|
|
438
431
|
command: `${command}`,
|
|
439
432
|
parameter: 'default',
|
|
440
433
|
commandType: 'command',
|
|
441
|
-
}
|
|
434
|
+
}
|
|
442
435
|
await this.debugLog(`SwitchBot OpenAPI bodyChange: ${JSON.stringify(bodyChange)}`)
|
|
443
436
|
try {
|
|
444
|
-
const { body
|
|
445
|
-
const deviceStatus: any = await body
|
|
446
|
-
await this.debugLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
447
|
-
if (await this.successfulStatusCodes(
|
|
448
|
-
await this.debugSuccessLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
437
|
+
const { body } = await this.pushChangeRequest(bodyChange)
|
|
438
|
+
const deviceStatus: any = await body
|
|
439
|
+
await this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
440
|
+
if (await this.successfulStatusCodes(deviceStatus)) {
|
|
441
|
+
await this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
449
442
|
await this.updateHomeKitCharacteristics()
|
|
450
443
|
} else {
|
|
451
|
-
await this.statusCode(statusCode)
|
|
452
444
|
await this.statusCode(deviceStatus.statusCode)
|
|
453
445
|
}
|
|
454
446
|
} catch (e: any) {
|
|
@@ -471,21 +463,20 @@ export class RobotVacuumCleaner extends deviceBase {
|
|
|
471
463
|
: this.LightBulb.Brightness === 75
|
|
472
464
|
? '2'
|
|
473
465
|
: this.LightBulb.Brightness === 100 ? '3' : 'default'
|
|
474
|
-
const bodyChange =
|
|
466
|
+
const bodyChange: bodyChange = {
|
|
475
467
|
command: `${command}`,
|
|
476
468
|
parameter: `${parameter}`,
|
|
477
469
|
commandType: 'command',
|
|
478
|
-
}
|
|
470
|
+
}
|
|
479
471
|
await this.debugLog(`SwitchBot OpenAPI bodyChange: ${JSON.stringify(bodyChange)}`)
|
|
480
472
|
try {
|
|
481
|
-
const { body
|
|
482
|
-
const deviceStatus: any = await body
|
|
483
|
-
await this.debugLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
484
|
-
if (await this.successfulStatusCodes(
|
|
485
|
-
await this.debugSuccessLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
473
|
+
const { body } = await this.pushChangeRequest(bodyChange)
|
|
474
|
+
const deviceStatus: any = await body
|
|
475
|
+
await this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
476
|
+
if (await this.successfulStatusCodes(deviceStatus)) {
|
|
477
|
+
await this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
486
478
|
await this.updateHomeKitCharacteristics()
|
|
487
479
|
} else {
|
|
488
|
-
await this.statusCode(statusCode)
|
|
489
480
|
await this.statusCode(deviceStatus.statusCode)
|
|
490
481
|
}
|
|
491
482
|
} catch (e: any) {
|
|
@@ -3,13 +3,10 @@
|
|
|
3
3
|
* waterdetector.ts: @switchbot/homebridge-switchbot.
|
|
4
4
|
*/
|
|
5
5
|
import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'
|
|
6
|
+
import type { device, waterLeakDetectorServiceData, waterLeakDetectorStatus, waterLeakDetectorWebhookContext } from 'node-switchbot'
|
|
6
7
|
|
|
7
8
|
import type { SwitchBotPlatform } from '../platform.js'
|
|
8
9
|
import type { devicesConfig } from '../settings.js'
|
|
9
|
-
import type { waterLeakDetectorServiceData } from '../types/bledevicestatus.js'
|
|
10
|
-
import type { device } from '../types/devicelist.js'
|
|
11
|
-
import type { waterLeakDetectorStatus } from '../types/devicestatus.js'
|
|
12
|
-
import type { waterLeakDetectorWebhookContext } from '../types/devicewebhookstatus.js'
|
|
13
10
|
|
|
14
11
|
/*
|
|
15
12
|
* For Testing Locally:
|
|
@@ -321,17 +318,17 @@ export class WaterDetector extends deviceBase {
|
|
|
321
318
|
async openAPIRefreshStatus(): Promise<void> {
|
|
322
319
|
await this.debugLog('openAPIRefreshStatus')
|
|
323
320
|
try {
|
|
324
|
-
const { body
|
|
325
|
-
const deviceStatus: any = await body
|
|
326
|
-
await this.debugLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
327
|
-
if (await this.successfulStatusCodes(
|
|
328
|
-
await this.debugSuccessLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
321
|
+
const { body } = await this.deviceRefreshStatus()
|
|
322
|
+
const deviceStatus: any = await body
|
|
323
|
+
await this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
324
|
+
if (await this.successfulStatusCodes(deviceStatus)) {
|
|
325
|
+
await this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
329
326
|
this.deviceStatus = deviceStatus.body
|
|
330
327
|
await this.openAPIparseStatus()
|
|
331
328
|
await this.updateHomeKitCharacteristics()
|
|
332
329
|
} else {
|
|
333
|
-
await this.debugWarnLog(`statusCode: ${statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
334
|
-
await this.debugWarnLog(
|
|
330
|
+
await this.debugWarnLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
331
|
+
await this.debugWarnLog(deviceStatus)
|
|
335
332
|
}
|
|
336
333
|
} catch (e: any) {
|
|
337
334
|
await this.apiError(e)
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* airconditioners.ts: @switchbot/homebridge-switchbot.
|
|
4
4
|
*/
|
|
5
5
|
import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'
|
|
6
|
+
import type { bodyChange, irdevice } from 'node-switchbot'
|
|
6
7
|
|
|
7
8
|
import type { SwitchBotPlatform } from '../platform.js'
|
|
8
9
|
import type { irDevicesConfig } from '../settings.js'
|
|
9
|
-
import type { irdevice } from '../types/irdevicelist.js'
|
|
10
10
|
|
|
11
11
|
import { irdeviceBase } from './irdevice.js'
|
|
12
12
|
|
|
@@ -162,11 +162,11 @@ export class AirConditioner extends irdeviceBase {
|
|
|
162
162
|
if (this.HeaterCooler.Active === this.hap.Characteristic.Active.ACTIVE && !this.disablePushOn) {
|
|
163
163
|
const commandType: string = await this.commandType()
|
|
164
164
|
const command: string = await this.commandOn()
|
|
165
|
-
const bodyChange =
|
|
165
|
+
const bodyChange: bodyChange = {
|
|
166
166
|
command,
|
|
167
167
|
parameter: 'default',
|
|
168
168
|
commandType,
|
|
169
|
-
}
|
|
169
|
+
}
|
|
170
170
|
await this.pushChanges(bodyChange)
|
|
171
171
|
}
|
|
172
172
|
}
|
|
@@ -176,11 +176,11 @@ export class AirConditioner extends irdeviceBase {
|
|
|
176
176
|
if (this.HeaterCooler.Active === this.hap.Characteristic.Active.INACTIVE && !this.disablePushOff) {
|
|
177
177
|
const commandType: string = await this.commandType()
|
|
178
178
|
const command: string = await this.commandOff()
|
|
179
|
-
const bodyChange =
|
|
179
|
+
const bodyChange: bodyChange = {
|
|
180
180
|
command,
|
|
181
181
|
parameter: 'default',
|
|
182
182
|
commandType,
|
|
183
|
-
}
|
|
183
|
+
}
|
|
184
184
|
await this.pushChanges(bodyChange)
|
|
185
185
|
}
|
|
186
186
|
}
|
|
@@ -219,12 +219,11 @@ export class AirConditioner extends irdeviceBase {
|
|
|
219
219
|
const parameter = `${this.HeaterCooler.ThresholdTemperature},${this.CurrentMode},${this.CurrentFanSpeed},${this.state}`
|
|
220
220
|
|
|
221
221
|
await this.UpdateCurrentHeaterCoolerState()
|
|
222
|
-
const bodyChange =
|
|
222
|
+
const bodyChange: bodyChange = {
|
|
223
223
|
command: 'setAll',
|
|
224
224
|
parameter: `${parameter}`,
|
|
225
225
|
commandType: 'command',
|
|
226
|
-
}
|
|
227
|
-
|
|
226
|
+
}
|
|
228
227
|
await this.pushChanges(bodyChange)
|
|
229
228
|
}
|
|
230
229
|
|
|
@@ -317,14 +316,13 @@ export class AirConditioner extends irdeviceBase {
|
|
|
317
316
|
if (this.device.connectionType === 'OpenAPI' && !this.disablePushDetail) {
|
|
318
317
|
await this.infoLog(`Sending request to SwitchBot API, body: ${bodyChange},`)
|
|
319
318
|
try {
|
|
320
|
-
const { body
|
|
321
|
-
const deviceStatus: any = await body
|
|
322
|
-
await this.pushStatusCodes(
|
|
323
|
-
if (await this.successfulStatusCodes(
|
|
324
|
-
await this.successfulPushChange(
|
|
319
|
+
const { body } = await this.pushChangeRequest(bodyChange)
|
|
320
|
+
const deviceStatus: any = await body
|
|
321
|
+
await this.pushStatusCodes(deviceStatus)
|
|
322
|
+
if (await this.successfulStatusCodes(deviceStatus)) {
|
|
323
|
+
await this.successfulPushChange(deviceStatus, bodyChange)
|
|
325
324
|
await this.updateHomeKitCharacteristics()
|
|
326
325
|
} else {
|
|
327
|
-
await this.statusCode(statusCode)
|
|
328
326
|
await this.statusCode(deviceStatus.statusCode)
|
|
329
327
|
}
|
|
330
328
|
} catch (e: any) {
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* airpurifier.ts: @switchbot/homebridge-switchbot.
|
|
4
4
|
*/
|
|
5
5
|
import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'
|
|
6
|
+
import type { bodyChange, irdevice } from 'node-switchbot'
|
|
6
7
|
|
|
7
8
|
import type { SwitchBotPlatform } from '../platform.js'
|
|
8
9
|
import type { irDevicesConfig } from '../settings.js'
|
|
9
|
-
import type { irdevice } from '../types/irdevicelist.js'
|
|
10
10
|
|
|
11
11
|
import { irdeviceBase } from './irdevice.js'
|
|
12
12
|
|
|
@@ -149,11 +149,11 @@ export class AirPurifier extends irdeviceBase {
|
|
|
149
149
|
if (this.AirPurifier.Active === this.hap.Characteristic.Active.ACTIVE && !this.disablePushOn) {
|
|
150
150
|
const commandType: string = await this.commandType()
|
|
151
151
|
const command: string = await this.commandOn()
|
|
152
|
-
const bodyChange =
|
|
152
|
+
const bodyChange: bodyChange = {
|
|
153
153
|
command,
|
|
154
154
|
parameter: 'default',
|
|
155
155
|
commandType,
|
|
156
|
-
}
|
|
156
|
+
}
|
|
157
157
|
await this.pushChanges(bodyChange)
|
|
158
158
|
}
|
|
159
159
|
}
|
|
@@ -163,11 +163,11 @@ export class AirPurifier extends irdeviceBase {
|
|
|
163
163
|
if (this.AirPurifier.Active === this.hap.Characteristic.Active.INACTIVE && !this.disablePushOn) {
|
|
164
164
|
const commandType: string = await this.commandType()
|
|
165
165
|
const command: string = await this.commandOff()
|
|
166
|
-
const bodyChange =
|
|
166
|
+
const bodyChange: bodyChange = {
|
|
167
167
|
command,
|
|
168
168
|
parameter: 'default',
|
|
169
169
|
commandType,
|
|
170
|
-
}
|
|
170
|
+
}
|
|
171
171
|
await this.pushChanges(bodyChange)
|
|
172
172
|
}
|
|
173
173
|
}
|
|
@@ -191,11 +191,11 @@ export class AirPurifier extends irdeviceBase {
|
|
|
191
191
|
this.CurrentAPFanSpeed = this.CurrentFanSpeed ?? 1
|
|
192
192
|
this.APActive = this.AirPurifier.Active === 1 ? 'on' : 'off'
|
|
193
193
|
const parameter = `${this.CurrentAPTemp},${this.CurrentAPMode},${this.CurrentAPFanSpeed},${this.APActive}`
|
|
194
|
-
const bodyChange =
|
|
194
|
+
const bodyChange: bodyChange = {
|
|
195
195
|
command: 'setAll',
|
|
196
196
|
parameter: `${parameter}`,
|
|
197
197
|
commandType: 'command',
|
|
198
|
-
}
|
|
198
|
+
}
|
|
199
199
|
if (this.AirPurifier.Active === 1) {
|
|
200
200
|
if ((Number(this.TemperatureSensor!.CurrentTemperature) || 24) < (this.LastTemperature || 30)) {
|
|
201
201
|
this.AirPurifier.CurrentHeaterCoolerState = this.hap.Characteristic.CurrentHeaterCoolerState.COOLING
|
|
@@ -213,14 +213,13 @@ export class AirPurifier extends irdeviceBase {
|
|
|
213
213
|
if (this.device.connectionType === 'OpenAPI') {
|
|
214
214
|
this.infoLog(`Sending request to SwitchBot API, body: ${bodyChange},`)
|
|
215
215
|
try {
|
|
216
|
-
const { body
|
|
217
|
-
const deviceStatus: any = await body
|
|
218
|
-
await this.pushStatusCodes(
|
|
219
|
-
if (await this.successfulStatusCodes(
|
|
220
|
-
await this.successfulPushChange(
|
|
216
|
+
const { body } = await this.pushChangeRequest(bodyChange)
|
|
217
|
+
const deviceStatus: any = await body
|
|
218
|
+
await this.pushStatusCodes(deviceStatus)
|
|
219
|
+
if (await this.successfulStatusCodes(deviceStatus)) {
|
|
220
|
+
await this.successfulPushChange(deviceStatus, bodyChange)
|
|
221
221
|
await this.updateHomeKitCharacteristics()
|
|
222
222
|
} else {
|
|
223
|
-
await this.statusCode(statusCode)
|
|
224
223
|
await this.statusCode(deviceStatus.statusCode)
|
|
225
224
|
}
|
|
226
225
|
} catch (e: any) {
|
package/src/irdevice/camera.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* camera.ts: @switchbot/homebridge-switchbot.
|
|
4
4
|
*/
|
|
5
5
|
import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'
|
|
6
|
+
import type { bodyChange, irdevice } from 'node-switchbot'
|
|
6
7
|
|
|
7
8
|
import type { SwitchBotPlatform } from '../platform.js'
|
|
8
9
|
import type { irDevicesConfig } from '../settings.js'
|
|
9
|
-
import type { irdevice } from '../types/irdevicelist.js'
|
|
10
10
|
|
|
11
11
|
import { irdeviceBase } from './irdevice.js'
|
|
12
12
|
|
|
@@ -72,11 +72,11 @@ export class Camera extends irdeviceBase {
|
|
|
72
72
|
if (this.Switch.On && !this.disablePushOn) {
|
|
73
73
|
const commandType: string = await this.commandType()
|
|
74
74
|
const command: string = await this.commandOn()
|
|
75
|
-
const bodyChange =
|
|
75
|
+
const bodyChange: bodyChange = {
|
|
76
76
|
command,
|
|
77
77
|
parameter: 'default',
|
|
78
78
|
commandType,
|
|
79
|
-
}
|
|
79
|
+
}
|
|
80
80
|
await this.pushChanges(bodyChange)
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -86,11 +86,11 @@ export class Camera extends irdeviceBase {
|
|
|
86
86
|
if (!this.Switch.On && !this.disablePushOff) {
|
|
87
87
|
const commandType: string = await this.commandType()
|
|
88
88
|
const command: string = await this.commandOff()
|
|
89
|
-
const bodyChange =
|
|
89
|
+
const bodyChange: bodyChange = {
|
|
90
90
|
command,
|
|
91
91
|
parameter: 'default',
|
|
92
92
|
commandType,
|
|
93
|
-
}
|
|
93
|
+
}
|
|
94
94
|
await this.pushChanges(bodyChange)
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -100,14 +100,13 @@ export class Camera extends irdeviceBase {
|
|
|
100
100
|
if (this.device.connectionType === 'OpenAPI') {
|
|
101
101
|
this.infoLog(`Sending request to SwitchBot API, body: ${bodyChange},`)
|
|
102
102
|
try {
|
|
103
|
-
const { body
|
|
104
|
-
const deviceStatus: any = await body
|
|
105
|
-
await this.pushStatusCodes(
|
|
106
|
-
if (await this.successfulStatusCodes(
|
|
107
|
-
await this.successfulPushChange(
|
|
103
|
+
const { body } = await this.pushChangeRequest(bodyChange)
|
|
104
|
+
const deviceStatus: any = await body
|
|
105
|
+
await this.pushStatusCodes(deviceStatus)
|
|
106
|
+
if (await this.successfulStatusCodes(deviceStatus)) {
|
|
107
|
+
await this.successfulPushChange(deviceStatus, bodyChange)
|
|
108
108
|
await this.updateHomeKitCharacteristics()
|
|
109
109
|
} else {
|
|
110
|
-
await this.statusCode(statusCode)
|
|
111
110
|
await this.statusCode(deviceStatus.statusCode)
|
|
112
111
|
}
|
|
113
112
|
} catch (e: any) {
|
package/src/irdevice/fan.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* fan.ts: @switchbot/homebridge-switchbot.
|
|
4
4
|
*/
|
|
5
5
|
import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'
|
|
6
|
+
import type { bodyChange, irdevice } from 'node-switchbot'
|
|
6
7
|
|
|
7
8
|
import type { SwitchBotPlatform } from '../platform.js'
|
|
8
9
|
import type { irDevicesConfig } from '../settings.js'
|
|
9
|
-
import type { irdevice } from '../types/irdevicelist.js'
|
|
10
10
|
|
|
11
11
|
import { irdeviceBase } from './irdevice.js'
|
|
12
12
|
|
|
@@ -136,11 +136,11 @@ export class IRFan extends irdeviceBase {
|
|
|
136
136
|
if (this.Fan.Active === this.hap.Characteristic.Active.ACTIVE && !this.disablePushOn) {
|
|
137
137
|
const commandType: string = await this.commandType()
|
|
138
138
|
const command: string = await this.commandOn()
|
|
139
|
-
const bodyChange =
|
|
139
|
+
const bodyChange: bodyChange = {
|
|
140
140
|
command,
|
|
141
141
|
parameter: 'default',
|
|
142
142
|
commandType,
|
|
143
|
-
}
|
|
143
|
+
}
|
|
144
144
|
await this.pushChanges(bodyChange)
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -150,39 +150,39 @@ export class IRFan extends irdeviceBase {
|
|
|
150
150
|
if (this.Fan.Active === this.hap.Characteristic.Active.INACTIVE && !this.disablePushOff) {
|
|
151
151
|
const commandType: string = await this.commandType()
|
|
152
152
|
const command: string = await this.commandOff()
|
|
153
|
-
const bodyChange =
|
|
153
|
+
const bodyChange: bodyChange = {
|
|
154
154
|
command,
|
|
155
155
|
parameter: 'default',
|
|
156
156
|
commandType,
|
|
157
|
-
}
|
|
157
|
+
}
|
|
158
158
|
await this.pushChanges(bodyChange)
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
async pushFanSpeedUpChanges(): Promise<void> {
|
|
163
|
-
const bodyChange =
|
|
163
|
+
const bodyChange: bodyChange = {
|
|
164
164
|
command: 'highSpeed',
|
|
165
165
|
parameter: 'default',
|
|
166
166
|
commandType: 'command',
|
|
167
|
-
}
|
|
167
|
+
}
|
|
168
168
|
await this.pushChanges(bodyChange)
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
async pushFanSpeedDownChanges(): Promise<void> {
|
|
172
|
-
const bodyChange =
|
|
172
|
+
const bodyChange: bodyChange = {
|
|
173
173
|
command: 'lowSpeed',
|
|
174
174
|
parameter: 'default',
|
|
175
175
|
commandType: 'command',
|
|
176
|
-
}
|
|
176
|
+
}
|
|
177
177
|
await this.pushChanges(bodyChange)
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
async pushFanSwingChanges(): Promise<void> {
|
|
181
|
-
const bodyChange =
|
|
181
|
+
const bodyChange: bodyChange = {
|
|
182
182
|
command: 'swing',
|
|
183
183
|
parameter: 'default',
|
|
184
184
|
commandType: 'command',
|
|
185
|
-
}
|
|
185
|
+
}
|
|
186
186
|
await this.pushChanges(bodyChange)
|
|
187
187
|
}
|
|
188
188
|
|
|
@@ -191,14 +191,13 @@ export class IRFan extends irdeviceBase {
|
|
|
191
191
|
if (this.device.connectionType === 'OpenAPI') {
|
|
192
192
|
this.infoLog(`Sending request to SwitchBot API, body: ${bodyChange},`)
|
|
193
193
|
try {
|
|
194
|
-
const { body
|
|
195
|
-
const deviceStatus: any = await body
|
|
196
|
-
await this.pushStatusCodes(
|
|
197
|
-
if (await this.successfulStatusCodes(
|
|
198
|
-
await this.successfulPushChange(
|
|
194
|
+
const { body } = await this.pushChangeRequest(bodyChange)
|
|
195
|
+
const deviceStatus: any = await body
|
|
196
|
+
await this.pushStatusCodes(deviceStatus)
|
|
197
|
+
if (await this.successfulStatusCodes(deviceStatus)) {
|
|
198
|
+
await this.successfulPushChange(deviceStatus, bodyChange)
|
|
199
199
|
await this.updateHomeKitCharacteristics()
|
|
200
200
|
} else {
|
|
201
|
-
await this.statusCode(statusCode)
|
|
202
201
|
await this.statusCode(deviceStatus.statusCode)
|
|
203
202
|
}
|
|
204
203
|
} catch (e: any) {
|
package/src/irdevice/irdevice.ts
CHANGED
|
@@ -3,14 +3,10 @@
|
|
|
3
3
|
* device.ts: @switchbot/homebridge-switchbot.
|
|
4
4
|
*/
|
|
5
5
|
import type { API, CharacteristicValue, HAP, Logging, PlatformAccessory, Service } from 'homebridge'
|
|
6
|
+
import type { bodyChange, irdevice } from 'node-switchbot'
|
|
6
7
|
|
|
7
8
|
import type { SwitchBotPlatform } from '../platform.js'
|
|
8
9
|
import type { irDevicesConfig, SwitchBotPlatformConfig } from '../settings.js'
|
|
9
|
-
import type { irdevice } from '../types/irdevicelist.js'
|
|
10
|
-
|
|
11
|
-
import { request } from 'undici'
|
|
12
|
-
|
|
13
|
-
import { Devices } from '../settings.js'
|
|
14
10
|
|
|
15
11
|
export abstract class irdeviceBase {
|
|
16
12
|
public readonly api: API
|
|
@@ -129,16 +125,13 @@ export abstract class irdeviceBase {
|
|
|
129
125
|
this.debugSuccessLog(`version: ${accessory.context.version}`)
|
|
130
126
|
}
|
|
131
127
|
|
|
132
|
-
async pushChangeRequest(bodyChange:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
method: 'POST',
|
|
136
|
-
headers: this.platform.generateHeaders(),
|
|
137
|
-
})
|
|
128
|
+
async pushChangeRequest(bodyChange: bodyChange): Promise<{ body: any, statusCode: number }> {
|
|
129
|
+
const { response, statusCode } = await this.platform.switchBotAPI.controlDevice(this.device.deviceId, bodyChange.command, bodyChange.parameter, bodyChange.commandType)
|
|
130
|
+
return { body: response, statusCode }
|
|
138
131
|
}
|
|
139
132
|
|
|
140
|
-
async successfulStatusCodes(
|
|
141
|
-
return (
|
|
133
|
+
async successfulStatusCodes(deviceStatus: any) {
|
|
134
|
+
return (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)
|
|
142
135
|
}
|
|
143
136
|
|
|
144
137
|
/**
|
|
@@ -163,14 +156,13 @@ export abstract class irdeviceBase {
|
|
|
163
156
|
}
|
|
164
157
|
}
|
|
165
158
|
|
|
166
|
-
async pushStatusCodes(
|
|
167
|
-
await this.debugWarnLog(`statusCode: ${statusCode}`)
|
|
159
|
+
async pushStatusCodes(deviceStatus: any) {
|
|
168
160
|
await this.debugWarnLog(`deviceStatus: ${JSON.stringify(deviceStatus)}`)
|
|
169
161
|
await this.debugWarnLog(`deviceStatus statusCode: ${deviceStatus.statusCode}`)
|
|
170
162
|
}
|
|
171
163
|
|
|
172
|
-
async successfulPushChange(
|
|
173
|
-
this.debugSuccessLog(`
|
|
164
|
+
async successfulPushChange(deviceStatus: any, bodyChange: any) {
|
|
165
|
+
this.debugSuccessLog(`deviceStatus StatusCode: ${deviceStatus.statusCode}`)
|
|
174
166
|
this.successLog(`request to SwitchBot API, body: ${JSON.stringify(JSON.parse(bodyChange))} sent successfully`)
|
|
175
167
|
}
|
|
176
168
|
|
package/src/irdevice/light.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* light.ts: @switchbot/homebridge-switchbot.
|
|
4
4
|
*/
|
|
5
5
|
import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'
|
|
6
|
+
import type { bodyChange, irdevice } from 'node-switchbot'
|
|
6
7
|
|
|
7
8
|
import type { SwitchBotPlatform } from '../platform.js'
|
|
8
9
|
import type { irDevicesConfig } from '../settings.js'
|
|
9
|
-
import type { irdevice } from '../types/irdevicelist.js'
|
|
10
10
|
|
|
11
11
|
import { irdeviceBase } from './irdevice.js'
|
|
12
12
|
|
|
@@ -170,11 +170,11 @@ export class Light extends irdeviceBase {
|
|
|
170
170
|
if (On === true && this.disablePushOn === false) {
|
|
171
171
|
const commandType: string = await this.commandType()
|
|
172
172
|
const command: string = await this.commandOn()
|
|
173
|
-
const bodyChange =
|
|
173
|
+
const bodyChange: bodyChange = {
|
|
174
174
|
command,
|
|
175
175
|
parameter: 'default',
|
|
176
176
|
commandType,
|
|
177
|
-
}
|
|
177
|
+
}
|
|
178
178
|
await this.pushChanges(bodyChange, On)
|
|
179
179
|
}
|
|
180
180
|
}
|
|
@@ -184,11 +184,11 @@ export class Light extends irdeviceBase {
|
|
|
184
184
|
if (On === false && this.disablePushOff === false) {
|
|
185
185
|
const commandType: string = await this.commandType()
|
|
186
186
|
const command: string = await this.commandOff()
|
|
187
|
-
const bodyChange =
|
|
187
|
+
const bodyChange: bodyChange = {
|
|
188
188
|
command,
|
|
189
189
|
parameter: 'default',
|
|
190
190
|
commandType,
|
|
191
|
-
}
|
|
191
|
+
}
|
|
192
192
|
await this.pushChanges(bodyChange, On)
|
|
193
193
|
}
|
|
194
194
|
}
|
|
@@ -198,15 +198,14 @@ export class Light extends irdeviceBase {
|
|
|
198
198
|
if (this.device.connectionType === 'OpenAPI') {
|
|
199
199
|
this.infoLog(`Sending request to SwitchBot API, body: ${bodyChange},`)
|
|
200
200
|
try {
|
|
201
|
-
const { body
|
|
202
|
-
const deviceStatus: any = await body
|
|
203
|
-
await this.pushStatusCodes(
|
|
204
|
-
if (await this.successfulStatusCodes(
|
|
205
|
-
await this.successfulPushChange(
|
|
201
|
+
const { body } = await this.pushChangeRequest(bodyChange)
|
|
202
|
+
const deviceStatus: any = await body
|
|
203
|
+
await this.pushStatusCodes(deviceStatus)
|
|
204
|
+
if (await this.successfulStatusCodes(deviceStatus)) {
|
|
205
|
+
await this.successfulPushChange(deviceStatus, bodyChange)
|
|
206
206
|
this.accessory.context.On = On
|
|
207
207
|
await this.updateHomeKitCharacteristics()
|
|
208
208
|
} else {
|
|
209
|
-
await this.statusCode(statusCode)
|
|
210
209
|
await this.statusCode(deviceStatus.statusCode)
|
|
211
210
|
}
|
|
212
211
|
} catch (e: any) {
|
package/src/irdevice/other.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* other.ts: @switchbot/homebridge-switchbot.
|
|
4
4
|
*/
|
|
5
5
|
import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'
|
|
6
|
+
import type { bodyChange, irdevice } from 'node-switchbot'
|
|
6
7
|
|
|
7
8
|
import type { SwitchBotPlatform } from '../platform.js'
|
|
8
9
|
import type { irDevicesConfig } from '../settings.js'
|
|
9
|
-
import type { irdevice } from '../types/irdevicelist.js'
|
|
10
10
|
|
|
11
11
|
import { irdeviceBase } from './irdevice.js'
|
|
12
12
|
|
|
@@ -412,11 +412,11 @@ export class Others extends irdeviceBase {
|
|
|
412
412
|
if (On === true && !this.disablePushOn) {
|
|
413
413
|
const commandType: string = await this.commandType()
|
|
414
414
|
const command: string = await this.commandOn()
|
|
415
|
-
const bodyChange =
|
|
415
|
+
const bodyChange: bodyChange = {
|
|
416
416
|
command,
|
|
417
417
|
parameter: 'default',
|
|
418
418
|
commandType,
|
|
419
|
-
}
|
|
419
|
+
}
|
|
420
420
|
await this.pushChanges(bodyChange)
|
|
421
421
|
}
|
|
422
422
|
} else {
|
|
@@ -430,11 +430,11 @@ export class Others extends irdeviceBase {
|
|
|
430
430
|
if (On === false && !this.disablePushOff) {
|
|
431
431
|
const commandType: string = await this.commandType()
|
|
432
432
|
const command: string = await this.commandOff()
|
|
433
|
-
const bodyChange =
|
|
433
|
+
const bodyChange: bodyChange = {
|
|
434
434
|
command,
|
|
435
435
|
parameter: 'default',
|
|
436
436
|
commandType,
|
|
437
|
-
}
|
|
437
|
+
}
|
|
438
438
|
await this.pushChanges(bodyChange)
|
|
439
439
|
}
|
|
440
440
|
} else {
|
|
@@ -447,14 +447,13 @@ export class Others extends irdeviceBase {
|
|
|
447
447
|
if (this.device.connectionType === 'OpenAPI') {
|
|
448
448
|
this.infoLog(`Sending request to SwitchBot API, body: ${bodyChange},`)
|
|
449
449
|
try {
|
|
450
|
-
const { body
|
|
451
|
-
const deviceStatus: any = await body
|
|
452
|
-
await this.pushStatusCodes(
|
|
453
|
-
if (await this.successfulStatusCodes(
|
|
454
|
-
await this.successfulPushChange(
|
|
450
|
+
const { body } = await this.pushChangeRequest(bodyChange)
|
|
451
|
+
const deviceStatus: any = await body
|
|
452
|
+
await this.pushStatusCodes(deviceStatus)
|
|
453
|
+
if (await this.successfulStatusCodes(deviceStatus)) {
|
|
454
|
+
await this.successfulPushChange(deviceStatus, bodyChange)
|
|
455
455
|
await this.updateHomeKitCharacteristics()
|
|
456
456
|
} else {
|
|
457
|
-
await this.statusCode(statusCode)
|
|
458
457
|
await this.statusCode(deviceStatus.statusCode)
|
|
459
458
|
}
|
|
460
459
|
} catch (e: any) {
|