@switchbot/homebridge-switchbot 4.1.4 → 4.1.6-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/.github/npm-version-script.cjs +81 -0
- package/CHANGELOG.md +8 -0
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +3 -3
- package/dist/device/bot.js.map +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +3 -3
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/device.d.ts.map +1 -1
- package/dist/device/device.js +5 -2
- package/dist/device/device.js.map +1 -1
- package/dist/homebridge-ui/public/index.html +3 -0
- package/dist/irdevice/airconditioner.js +9 -9
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.js +6 -6
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.js +4 -4
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.js +4 -4
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/irdevice.d.ts +9 -6
- package/dist/irdevice/irdevice.d.ts.map +1 -1
- package/dist/irdevice/irdevice.js +42 -29
- package/dist/irdevice/irdevice.js.map +1 -1
- package/dist/irdevice/light.js +4 -4
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.js +4 -4
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.js +22 -22
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +4 -4
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.js +4 -4
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/settings.d.ts +5 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/icons.js +1 -1
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +5 -5
- package/docs/assets/style.css +1391 -1288
- package/docs/functions/default.html +1 -1
- package/docs/index.html +14 -14
- package/docs/modules.html +1 -2
- package/package.json +8 -8
- package/src/device/bot.ts +4 -5
- package/src/device/curtain.ts +4 -5
- package/src/device/device.ts +5 -2
- package/src/homebridge-ui/public/index.html +3 -0
- package/src/irdevice/airconditioner.ts +9 -9
- package/src/irdevice/airpurifier.ts +6 -6
- package/src/irdevice/camera.ts +4 -4
- package/src/irdevice/fan.ts +4 -4
- package/src/irdevice/irdevice.ts +45 -30
- package/src/irdevice/light.ts +4 -4
- package/src/irdevice/other.ts +4 -4
- package/src/irdevice/tv.ts +22 -22
- package/src/irdevice/vacuumcleaner.ts +4 -4
- package/src/irdevice/waterheater.ts +4 -4
- package/src/settings.ts +5 -0
package/src/irdevice/irdevice.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Copyright(C) 2021-2024, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
2
|
*
|
|
3
|
-
*
|
|
3
|
+
* irdevice.ts: @switchbot/homebridge-switchbot.
|
|
4
4
|
*/
|
|
5
5
|
import type { API, CharacteristicValue, HAP, Logging, PlatformAccessory, Service } from 'homebridge'
|
|
6
6
|
import type { bodyChange, irdevice } from 'node-switchbot'
|
|
@@ -16,9 +16,14 @@ export abstract class irdeviceBase {
|
|
|
16
16
|
|
|
17
17
|
// Config
|
|
18
18
|
protected deviceLogging!: string
|
|
19
|
-
protected
|
|
20
|
-
protected
|
|
21
|
-
protected
|
|
19
|
+
protected deviceRefreshRate!: number
|
|
20
|
+
protected deviceUpdateRate!: number
|
|
21
|
+
protected devicePushRate!: number
|
|
22
|
+
protected deviceMaxRetries!: number
|
|
23
|
+
protected deviceDelayBetweenRetries!: number
|
|
24
|
+
protected deviceDisablePushOn!: boolean
|
|
25
|
+
protected deviceDisablePushOff!: boolean
|
|
26
|
+
protected deviceDisablePushDetail?: boolean
|
|
22
27
|
|
|
23
28
|
constructor(
|
|
24
29
|
protected readonly platform: SwitchBotPlatform,
|
|
@@ -31,10 +36,9 @@ export abstract class irdeviceBase {
|
|
|
31
36
|
this.hap = this.api.hap
|
|
32
37
|
|
|
33
38
|
this.getDeviceLogSettings(accessory, device)
|
|
39
|
+
this.getDeviceRateSettings(device)
|
|
34
40
|
this.getDeviceConfigSettings(device)
|
|
35
41
|
this.getDeviceContext(accessory, device)
|
|
36
|
-
this.disablePushOnChanges(device)
|
|
37
|
-
this.disablePushOffChanges(device)
|
|
38
42
|
|
|
39
43
|
// Set accessory information
|
|
40
44
|
accessory
|
|
@@ -55,6 +59,41 @@ export abstract class irdeviceBase {
|
|
|
55
59
|
this.debugLog(`Using ${logging} Logging: ${this.deviceLogging}`)
|
|
56
60
|
}
|
|
57
61
|
|
|
62
|
+
async getDeviceRateSettings(device: irdevice & irDevicesConfig): Promise<void> {
|
|
63
|
+
// refreshRate
|
|
64
|
+
this.deviceRefreshRate = device.refreshRate ?? this.platform.platformRefreshRate ?? 300
|
|
65
|
+
const refreshRate = device.refreshRate ? 'Device Config' : this.platform.platformRefreshRate ? 'Platform Config' : 'Default'
|
|
66
|
+
this.accessory.context.refreshRate = this.deviceRefreshRate
|
|
67
|
+
// updateRate
|
|
68
|
+
this.deviceUpdateRate = device.updateRate ?? this.platform.platformUpdateRate ?? 5
|
|
69
|
+
const updateRate = device.updateRate ? 'Device Config' : this.platform.platformUpdateRate ? 'Platform Config' : 'Default'
|
|
70
|
+
this.accessory.context.updateRate = this.deviceUpdateRate
|
|
71
|
+
// pushRate
|
|
72
|
+
this.devicePushRate = device.pushRate ?? this.platform.platformPushRate ?? 0.1
|
|
73
|
+
const pushRate = device.pushRate ? 'Device Config' : this.platform.platformPushRate ? 'Platform Config' : 'Default'
|
|
74
|
+
this.accessory.context.pushRate = this.devicePushRate
|
|
75
|
+
this.debugLog(`Using ${refreshRate} refreshRate: ${this.deviceRefreshRate}, ${updateRate} updateRate: ${this.deviceUpdateRate}, ${pushRate} pushRate: ${this.devicePushRate}`)
|
|
76
|
+
// maxRetries
|
|
77
|
+
this.deviceMaxRetries = device.maxRetries ?? this.platform.platformMaxRetries ?? 2
|
|
78
|
+
const maxRetries = device.maxRetries ? 'Device' : this.platform.platformMaxRetries ? 'Platform' : 'Default'
|
|
79
|
+
this.debugLog(`Using ${maxRetries} Max Retries: ${this.deviceMaxRetries}`)
|
|
80
|
+
// delayBetweenRetries
|
|
81
|
+
this.deviceDelayBetweenRetries = device.delayBetweenRetries ? (device.delayBetweenRetries * 1000) : this.platform.platformDelayBetweenRetries ?? 3000
|
|
82
|
+
const delayBetweenRetries = device.delayBetweenRetries ? 'Device' : this.platform.platformDelayBetweenRetries ? 'Platform' : 'Default'
|
|
83
|
+
this.debugLog(`Using ${delayBetweenRetries} Delay Between Retries: ${this.deviceDelayBetweenRetries}`)
|
|
84
|
+
|
|
85
|
+
// disablePushOn
|
|
86
|
+
this.deviceDisablePushOn = device.disablePushOn ?? false
|
|
87
|
+
const disablePushOn = device.disablePushOn ? 'Device Config' : 'Default'
|
|
88
|
+
// disablePushOff
|
|
89
|
+
this.deviceDisablePushOff = device.disablePushOff ?? false
|
|
90
|
+
const disablePushOff = device.disablePushOff ? 'Device Config' : 'Default'
|
|
91
|
+
// disablePushDetail
|
|
92
|
+
this.deviceDisablePushDetail = device.disablePushDetail ?? false
|
|
93
|
+
const disablePushDetail = device.disablePushDetail ? 'Device Config' : 'Default'
|
|
94
|
+
this.debugLog(`Using ${disablePushOn} Disable Push On: ${this.deviceDisablePushOn}, ${disablePushOff} Disable Push Off: ${this.deviceDisablePushOff}, ${disablePushDetail} Disable Push Detail: ${this.deviceDisablePushDetail}`)
|
|
95
|
+
}
|
|
96
|
+
|
|
58
97
|
async getDeviceConfigSettings(device: irdevice & irDevicesConfig): Promise<void> {
|
|
59
98
|
const deviceConfig = Object.assign(
|
|
60
99
|
{},
|
|
@@ -173,30 +212,6 @@ export abstract class irdeviceBase {
|
|
|
173
212
|
this.errorLog(`failed pushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
|
|
174
213
|
}
|
|
175
214
|
|
|
176
|
-
async disablePushOnChanges(device: irdevice & irDevicesConfig): Promise<void> {
|
|
177
|
-
if (device.disablePushOn === undefined) {
|
|
178
|
-
this.disablePushOn = false
|
|
179
|
-
} else {
|
|
180
|
-
this.disablePushOn = device.disablePushOn
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
async disablePushOffChanges(device: irdevice & irDevicesConfig): Promise<void> {
|
|
185
|
-
if (device.disablePushOff === undefined) {
|
|
186
|
-
this.disablePushOff = false
|
|
187
|
-
} else {
|
|
188
|
-
this.disablePushOff = device.disablePushOff
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
async disablePushDetailChanges(device: irdevice & irDevicesConfig): Promise<void> {
|
|
193
|
-
if (device.disablePushDetail === undefined) {
|
|
194
|
-
this.disablePushDetail = false
|
|
195
|
-
} else {
|
|
196
|
-
this.disablePushDetail = device.disablePushDetail
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
215
|
async commandType(): Promise<string> {
|
|
201
216
|
let commandType: string
|
|
202
217
|
if (this.device.commandType && this.device.customize) {
|
package/src/irdevice/light.ts
CHANGED
|
@@ -166,8 +166,8 @@ export class Light extends irdeviceBase {
|
|
|
166
166
|
* Light - "command" "channelSub" "default" = previous channel
|
|
167
167
|
*/
|
|
168
168
|
async pushLightOnChanges(On: boolean): Promise<void> {
|
|
169
|
-
this.debugLog(`pushLightOnChanges On: ${On}, disablePushOn: ${this.
|
|
170
|
-
if (On === true && this.
|
|
169
|
+
this.debugLog(`pushLightOnChanges On: ${On}, disablePushOn: ${this.deviceDisablePushOn}`)
|
|
170
|
+
if (On === true && this.deviceDisablePushOn === false) {
|
|
171
171
|
const commandType: string = await this.commandType()
|
|
172
172
|
const command: string = await this.commandOn()
|
|
173
173
|
const bodyChange: bodyChange = {
|
|
@@ -180,8 +180,8 @@ export class Light extends irdeviceBase {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
async pushLightOffChanges(On: boolean): Promise<void> {
|
|
183
|
-
this.debugLog(`pushLightOffChanges On: ${On}, disablePushOff: ${this.
|
|
184
|
-
if (On === false && this.
|
|
183
|
+
this.debugLog(`pushLightOffChanges On: ${On}, disablePushOff: ${this.deviceDisablePushOff}`)
|
|
184
|
+
if (On === false && this.deviceDisablePushOff === false) {
|
|
185
185
|
const commandType: string = await this.commandType()
|
|
186
186
|
const command: string = await this.commandOff()
|
|
187
187
|
const bodyChange: bodyChange = {
|
package/src/irdevice/other.ts
CHANGED
|
@@ -407,9 +407,9 @@ export class Others extends irdeviceBase {
|
|
|
407
407
|
* Other - "command" "channelSub" "default" = previous channel
|
|
408
408
|
*/
|
|
409
409
|
async pushOnChanges(On: boolean): Promise<void> {
|
|
410
|
-
this.debugLog(`pushOnChanges On: ${On}, disablePushOn: ${this.
|
|
410
|
+
this.debugLog(`pushOnChanges On: ${On}, disablePushOn: ${this.deviceDisablePushOn}, customize: ${this.device.customize}, customOn: ${this.device.customOn}`)
|
|
411
411
|
if (this.device.customize) {
|
|
412
|
-
if (On === true && !this.
|
|
412
|
+
if (On === true && !this.deviceDisablePushOn) {
|
|
413
413
|
const commandType: string = await this.commandType()
|
|
414
414
|
const command: string = await this.commandOn()
|
|
415
415
|
const bodyChange: bodyChange = {
|
|
@@ -425,9 +425,9 @@ export class Others extends irdeviceBase {
|
|
|
425
425
|
}
|
|
426
426
|
|
|
427
427
|
async pushOffChanges(On: boolean): Promise<void> {
|
|
428
|
-
this.debugLog(`pushOffChanges On: ${On}, disablePushOff: ${this.
|
|
428
|
+
this.debugLog(`pushOffChanges On: ${On}, disablePushOff: ${this.deviceDisablePushOff}, customize: ${this.device.customize}, customOff: ${this.device.customOff}`)
|
|
429
429
|
if (this.device.customize) {
|
|
430
|
-
if (On === false && !this.
|
|
430
|
+
if (On === false && !this.deviceDisablePushOff) {
|
|
431
431
|
const commandType: string = await this.commandType()
|
|
432
432
|
const command: string = await this.commandOff()
|
|
433
433
|
const bodyChange: bodyChange = {
|
package/src/irdevice/tv.ts
CHANGED
|
@@ -206,8 +206,8 @@ export class TV extends irdeviceBase {
|
|
|
206
206
|
* TV "command" "channelSub" "default" previous channel
|
|
207
207
|
*/
|
|
208
208
|
async pushTvOnChanges(): Promise<void> {
|
|
209
|
-
this.debugLog(`pushTvOnChanges Active: ${this.Television.Active}, disablePushOn: ${this.
|
|
210
|
-
if (this.Television.Active === this.hap.Characteristic.Active.ACTIVE && !this.
|
|
209
|
+
this.debugLog(`pushTvOnChanges Active: ${this.Television.Active}, disablePushOn: ${this.deviceDisablePushOn}`)
|
|
210
|
+
if (this.Television.Active === this.hap.Characteristic.Active.ACTIVE && !this.deviceDisablePushOn) {
|
|
211
211
|
const commandType: string = await this.commandType()
|
|
212
212
|
const command: string = await this.commandOn()
|
|
213
213
|
const bodyChange: bodyChange = {
|
|
@@ -220,8 +220,8 @@ export class TV extends irdeviceBase {
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
async pushTvOffChanges(): Promise<void> {
|
|
223
|
-
this.debugLog(`pushTvOffChanges Active: ${this.Television.Active}, disablePushOff: ${this.
|
|
224
|
-
if (this.Television.Active === this.hap.Characteristic.Active.INACTIVE && !this.
|
|
223
|
+
this.debugLog(`pushTvOffChanges Active: ${this.Television.Active}, disablePushOff: ${this.deviceDisablePushOff}`)
|
|
224
|
+
if (this.Television.Active === this.hap.Characteristic.Active.INACTIVE && !this.deviceDisablePushOff) {
|
|
225
225
|
const commandType: string = await this.commandType()
|
|
226
226
|
const command: string = await this.commandOff()
|
|
227
227
|
const bodyChange: bodyChange = {
|
|
@@ -234,8 +234,8 @@ export class TV extends irdeviceBase {
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
async pushOkChanges(): Promise<void> {
|
|
237
|
-
this.debugLog(`pushOkChanges disablePushDetail: ${this.
|
|
238
|
-
if (!this.
|
|
237
|
+
this.debugLog(`pushOkChanges disablePushDetail: ${this.deviceDisablePushDetail}`)
|
|
238
|
+
if (!this.deviceDisablePushDetail) {
|
|
239
239
|
const bodyChange: bodyChange = {
|
|
240
240
|
command: 'Ok',
|
|
241
241
|
parameter: 'default',
|
|
@@ -246,8 +246,8 @@ export class TV extends irdeviceBase {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
async pushBackChanges(): Promise<void> {
|
|
249
|
-
this.debugLog(`pushBackChanges disablePushDetail: ${this.
|
|
250
|
-
if (!this.
|
|
249
|
+
this.debugLog(`pushBackChanges disablePushDetail: ${this.deviceDisablePushDetail}`)
|
|
250
|
+
if (!this.deviceDisablePushDetail) {
|
|
251
251
|
const bodyChange: bodyChange = {
|
|
252
252
|
command: 'Back',
|
|
253
253
|
parameter: 'default',
|
|
@@ -258,8 +258,8 @@ export class TV extends irdeviceBase {
|
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
async pushMenuChanges(): Promise<void> {
|
|
261
|
-
this.debugLog(`pushMenuChanges disablePushDetail: ${this.
|
|
262
|
-
if (!this.
|
|
261
|
+
this.debugLog(`pushMenuChanges disablePushDetail: ${this.deviceDisablePushDetail}`)
|
|
262
|
+
if (!this.deviceDisablePushDetail) {
|
|
263
263
|
const bodyChange: bodyChange = {
|
|
264
264
|
command: 'Menu',
|
|
265
265
|
parameter: 'default',
|
|
@@ -270,8 +270,8 @@ export class TV extends irdeviceBase {
|
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
async pushUpChanges(): Promise<void> {
|
|
273
|
-
this.debugLog(`pushUpChanges disablePushDetail: ${this.
|
|
274
|
-
if (!this.
|
|
273
|
+
this.debugLog(`pushUpChanges disablePushDetail: ${this.deviceDisablePushDetail}`)
|
|
274
|
+
if (!this.deviceDisablePushDetail) {
|
|
275
275
|
const bodyChange: bodyChange = {
|
|
276
276
|
command: 'Up',
|
|
277
277
|
parameter: 'default',
|
|
@@ -282,8 +282,8 @@ export class TV extends irdeviceBase {
|
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
async pushDownChanges(): Promise<void> {
|
|
285
|
-
this.debugLog(`pushDownChanges disablePushDetail: ${this.
|
|
286
|
-
if (!this.
|
|
285
|
+
this.debugLog(`pushDownChanges disablePushDetail: ${this.deviceDisablePushDetail}`)
|
|
286
|
+
if (!this.deviceDisablePushDetail) {
|
|
287
287
|
const bodyChange: bodyChange = {
|
|
288
288
|
command: 'Down',
|
|
289
289
|
parameter: 'default',
|
|
@@ -294,8 +294,8 @@ export class TV extends irdeviceBase {
|
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
async pushRightChanges(): Promise<void> {
|
|
297
|
-
this.debugLog(`pushRightChanges disablePushDetail: ${this.
|
|
298
|
-
if (!this.
|
|
297
|
+
this.debugLog(`pushRightChanges disablePushDetail: ${this.deviceDisablePushDetail}`)
|
|
298
|
+
if (!this.deviceDisablePushDetail) {
|
|
299
299
|
const bodyChange: bodyChange = {
|
|
300
300
|
command: 'Right',
|
|
301
301
|
parameter: 'default',
|
|
@@ -306,8 +306,8 @@ export class TV extends irdeviceBase {
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
async pushLeftChanges(): Promise<void> {
|
|
309
|
-
this.debugLog(`pushLeftChanges disablePushDetail: ${this.
|
|
310
|
-
if (!this.
|
|
309
|
+
this.debugLog(`pushLeftChanges disablePushDetail: ${this.deviceDisablePushDetail}`)
|
|
310
|
+
if (!this.deviceDisablePushDetail) {
|
|
311
311
|
const bodyChange: bodyChange = {
|
|
312
312
|
command: 'Left',
|
|
313
313
|
parameter: 'default',
|
|
@@ -318,8 +318,8 @@ export class TV extends irdeviceBase {
|
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
async pushVolumeUpChanges(): Promise<void> {
|
|
321
|
-
this.debugLog(`pushVolumeUpChanges disablePushDetail: ${this.
|
|
322
|
-
if (!this.
|
|
321
|
+
this.debugLog(`pushVolumeUpChanges disablePushDetail: ${this.deviceDisablePushDetail}`)
|
|
322
|
+
if (!this.deviceDisablePushDetail) {
|
|
323
323
|
const bodyChange: bodyChange = {
|
|
324
324
|
command: 'volumeAdd',
|
|
325
325
|
parameter: 'default',
|
|
@@ -330,8 +330,8 @@ export class TV extends irdeviceBase {
|
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
async pushVolumeDownChanges(): Promise<void> {
|
|
333
|
-
this.debugLog(`pushVolumeDownChanges disablePushDetail: ${this.
|
|
334
|
-
if (!this.
|
|
333
|
+
this.debugLog(`pushVolumeDownChanges disablePushDetail: ${this.deviceDisablePushDetail}`)
|
|
334
|
+
if (!this.deviceDisablePushDetail) {
|
|
335
335
|
const bodyChange: bodyChange = {
|
|
336
336
|
command: 'volumeSub',
|
|
337
337
|
parameter: 'default',
|
|
@@ -65,8 +65,8 @@ export class VacuumCleaner extends irdeviceBase {
|
|
|
65
65
|
* Vacuum Cleaner "command" "turnOn" "default" set to ON state
|
|
66
66
|
*/
|
|
67
67
|
async pushOnChanges(): Promise<void> {
|
|
68
|
-
this.debugLog(`pushOnChanges On: ${this.Switch.On}, disablePushOn: ${this.
|
|
69
|
-
if (this.Switch.On && !this.
|
|
68
|
+
this.debugLog(`pushOnChanges On: ${this.Switch.On}, disablePushOn: ${this.deviceDisablePushOn}`)
|
|
69
|
+
if (this.Switch.On && !this.deviceDisablePushOn) {
|
|
70
70
|
const commandType: string = await this.commandType()
|
|
71
71
|
const command: string = await this.commandOn()
|
|
72
72
|
const bodyChange: bodyChange = {
|
|
@@ -79,8 +79,8 @@ export class VacuumCleaner extends irdeviceBase {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
async pushOffChanges(): Promise<void> {
|
|
82
|
-
this.debugLog(`pushOffChanges On: ${this.Switch.On}, disablePushOff: ${this.
|
|
83
|
-
if (!this.Switch.On && !this.
|
|
82
|
+
this.debugLog(`pushOffChanges On: ${this.Switch.On}, disablePushOff: ${this.deviceDisablePushOff}`)
|
|
83
|
+
if (!this.Switch.On && !this.deviceDisablePushOff) {
|
|
84
84
|
const commandType: string = await this.commandType()
|
|
85
85
|
const command: string = await this.commandOff()
|
|
86
86
|
const bodyChange: bodyChange = {
|
|
@@ -66,8 +66,8 @@ export class WaterHeater extends irdeviceBase {
|
|
|
66
66
|
* WaterHeater "command" "turnOn" "default" set to ON state
|
|
67
67
|
*/
|
|
68
68
|
async pushWaterHeaterOnChanges(): Promise<void> {
|
|
69
|
-
this.debugLog(`pushWaterHeaterOnChanges Active: ${this.Valve.Active}, disablePushOn: ${this.
|
|
70
|
-
if (this.Valve.Active === this.hap.Characteristic.Active.ACTIVE && !this.
|
|
69
|
+
this.debugLog(`pushWaterHeaterOnChanges Active: ${this.Valve.Active}, disablePushOn: ${this.deviceDisablePushOn}`)
|
|
70
|
+
if (this.Valve.Active === this.hap.Characteristic.Active.ACTIVE && !this.deviceDisablePushOn) {
|
|
71
71
|
const commandType: string = await this.commandType()
|
|
72
72
|
const command: string = await this.commandOn()
|
|
73
73
|
const bodyChange: bodyChange = {
|
|
@@ -80,8 +80,8 @@ export class WaterHeater extends irdeviceBase {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
async pushWaterHeaterOffChanges(): Promise<void> {
|
|
83
|
-
this.debugLog(`pushWaterHeaterOffChanges Active: ${this.Valve.Active}, disablePushOff: ${this.
|
|
84
|
-
if (this.Valve.Active === this.hap.Characteristic.Active.INACTIVE && !this.
|
|
83
|
+
this.debugLog(`pushWaterHeaterOffChanges Active: ${this.Valve.Active}, disablePushOff: ${this.deviceDisablePushOff}`)
|
|
84
|
+
if (this.Valve.Active === this.hap.Characteristic.Active.INACTIVE && !this.deviceDisablePushOff) {
|
|
85
85
|
const commandType: string = await this.commandType()
|
|
86
86
|
const command: string = await this.commandOff()
|
|
87
87
|
const bodyChange: bodyChange = {
|
package/src/settings.ts
CHANGED
|
@@ -220,6 +220,11 @@ export interface irBaseDeviceConfig extends irdevice {
|
|
|
220
220
|
connectionType?: string
|
|
221
221
|
hide_device?: boolean
|
|
222
222
|
external?: boolean
|
|
223
|
+
refreshRate?: number
|
|
224
|
+
updateRate?: number
|
|
225
|
+
pushRate?: number
|
|
226
|
+
maxRetries?: number
|
|
227
|
+
delayBetweenRetries?: number
|
|
223
228
|
firmware?: string
|
|
224
229
|
deviceId: string
|
|
225
230
|
logging?: string
|