@switchbot/homebridge-switchbot 3.5.0-beta.9 → 3.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/.vscode/settings.json +4 -1
- package/CHANGELOG.md +4 -1
- package/config.schema.json +166 -24
- package/dist/device/blindtilt.d.ts +21 -96
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +439 -817
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts +27 -72
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +835 -865
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts +15 -69
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +287 -653
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts +15 -76
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +354 -732
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts +14 -66
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +268 -576
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +18 -89
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +431 -851
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/device.d.ts +60 -0
- package/dist/device/device.d.ts.map +1 -0
- package/dist/device/device.js +739 -0
- package/dist/device/device.js.map +1 -0
- package/dist/device/fan.d.ts +63 -0
- package/dist/device/fan.d.ts.map +1 -0
- package/dist/device/fan.js +698 -0
- package/dist/device/fan.js.map +1 -0
- package/dist/device/hub.d.ts +15 -60
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +257 -631
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts +11 -66
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +266 -629
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts +12 -64
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +215 -615
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts +12 -70
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +336 -645
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts +17 -63
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +290 -595
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts +15 -64
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +211 -608
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts +15 -65
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +205 -615
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts +12 -69
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +202 -563
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts +10 -57
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +125 -484
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts +13 -63
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +233 -549
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/waterdetector.d.ts +11 -63
- package/dist/device/waterdetector.d.ts.map +1 -1
- package/dist/device/waterdetector.js +170 -493
- package/dist/device/waterdetector.js.map +1 -1
- package/dist/homebridge-ui/public/index.html +22 -16
- package/dist/homebridge-ui/server.js +1 -1
- package/dist/homebridge-ui/server.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +10 -50
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +340 -468
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts +8 -39
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +105 -319
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts +7 -36
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +44 -285
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts +7 -43
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +92 -350
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/irdevice.d.ts +40 -0
- package/dist/irdevice/irdevice.d.ts.map +1 -0
- package/dist/irdevice/irdevice.js +369 -0
- package/dist/irdevice/irdevice.js.map +1 -0
- package/dist/irdevice/light.d.ts +12 -45
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +118 -362
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts +19 -48
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +438 -570
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts +8 -40
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +91 -339
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts +7 -36
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +45 -285
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts +7 -36
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +47 -291
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts +22 -8
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +342 -191
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +64 -17
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +16 -552
- package/dist/settings.js.map +1 -1
- package/dist/utils.d.ts +77 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +638 -1
- package/dist/utils.js.map +1 -1
- package/eslint.config.js +96 -0
- package/package.json +20 -16
- package/src/custom.d.ts +2 -1
- package/src/device/blindtilt.ts +472 -888
- package/src/device/bot.ts +893 -968
- package/src/device/ceilinglight.ts +304 -709
- package/src/device/colorbulb.ts +370 -803
- package/src/device/contact.ts +301 -611
- package/src/device/curtain.ts +460 -908
- package/src/device/device.ts +755 -0
- package/src/device/fan.ts +749 -0
- package/src/device/hub.ts +294 -664
- package/src/device/humidifier.ts +299 -696
- package/src/device/iosensor.ts +251 -644
- package/src/device/lightstrip.ts +362 -712
- package/src/device/lock.ts +328 -653
- package/src/device/meter.ts +247 -637
- package/src/device/meterplus.ts +240 -644
- package/src/device/motion.ts +230 -598
- package/src/device/plug.ts +139 -525
- package/src/device/robotvacuumcleaner.ts +258 -593
- package/src/device/waterdetector.ts +191 -522
- package/src/homebridge-ui/public/index.html +22 -16
- package/src/homebridge-ui/server.ts +1 -1
- package/src/index.ts +4 -3
- package/src/irdevice/airconditioner.ts +370 -527
- package/src/irdevice/airpurifier.ts +132 -356
- package/src/irdevice/camera.ts +58 -311
- package/src/irdevice/fan.ts +109 -379
- package/src/irdevice/irdevice.ts +382 -0
- package/src/irdevice/light.ts +157 -412
- package/src/irdevice/other.ts +507 -648
- package/src/irdevice/tv.ts +121 -375
- package/src/irdevice/vacuumcleaner.ts +59 -311
- package/src/irdevice/waterheater.ts +61 -320
- package/src/platform.ts +395 -259
- package/src/settings.ts +118 -609
- package/src/utils.ts +642 -1
- package/.github/npm-version-script.cjs +0 -81
- package/src/device/waterdetector.json +0 -11
package/.vscode/settings.json
CHANGED
|
@@ -31,5 +31,8 @@
|
|
|
31
31
|
"editor.defaultFormatter": "vscode.json-language-features"
|
|
32
32
|
},
|
|
33
33
|
"codeQL.githubDatabase.update": "never",
|
|
34
|
-
"codeQL.githubDatabase.download": "never"
|
|
34
|
+
"codeQL.githubDatabase.download": "never",
|
|
35
|
+
"[html]": {
|
|
36
|
+
"editor.defaultFormatter": "vscode.html-language-features"
|
|
37
|
+
}
|
|
35
38
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/)
|
|
4
4
|
|
|
5
|
-
## [
|
|
5
|
+
## [3.5.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v3.5.0) (2024-05-26)
|
|
6
6
|
|
|
7
7
|
### What's Changed
|
|
8
8
|
- Add Support for `Water Detector`
|
|
9
|
+
- Add Support for `Battery Circulator Fan`
|
|
9
10
|
- Add BLE support for `Smart Lock`
|
|
10
11
|
- Add `K10+` deviceType Support
|
|
12
|
+
- Add Support for `maxRetries` and `delayBetweenRetries` on OpenAPI status refreshes based on [#959](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/959#issuecomment-2094879876), Thanks [@sametguzeldev](https://github.com/sametguzeldev)
|
|
13
|
+
- Major Refactoring of `device` and `irdevice` files.
|
|
11
14
|
- Housekeeping and updated dependencies.
|
|
12
15
|
|
|
13
16
|
**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v3.4.0...v3.5.0
|
package/config.schema.json
CHANGED
|
@@ -308,9 +308,30 @@
|
|
|
308
308
|
"title": "Hide Hub 2's Temperature Sensor",
|
|
309
309
|
"type": "boolean",
|
|
310
310
|
"condition": {
|
|
311
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device &&
|
|
311
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Hub 2' && model.options.devices[arrayIndices].deviceId);"
|
|
312
312
|
}
|
|
313
313
|
},
|
|
314
|
+
"convertUnitTo": {
|
|
315
|
+
"title": "Convert Hub's Temperature Unit To",
|
|
316
|
+
"type": "string",
|
|
317
|
+
"condition": {
|
|
318
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Hub 2' && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hub.hide_temperature);"
|
|
319
|
+
},
|
|
320
|
+
"oneOf": [
|
|
321
|
+
{
|
|
322
|
+
"title": "Celsius",
|
|
323
|
+
"enum": [
|
|
324
|
+
"CELSIUS"
|
|
325
|
+
]
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"title": "Fahrenheit",
|
|
329
|
+
"enum": [
|
|
330
|
+
"FAHRENHEIT"
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
},
|
|
314
335
|
"hide_humidity": {
|
|
315
336
|
"title": "Hide Hub 2's Humidity Sensor",
|
|
316
337
|
"type": "boolean",
|
|
@@ -478,14 +499,75 @@
|
|
|
478
499
|
"title": "Hide Meter's Temperature Sensor",
|
|
479
500
|
"type": "boolean",
|
|
480
501
|
"condition": {
|
|
481
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)'
|
|
502
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)') && model.options.devices[arrayIndices].deviceId);"
|
|
482
503
|
}
|
|
483
504
|
},
|
|
505
|
+
"convertUnitTo": {
|
|
506
|
+
"title": "Convert Meter's Temperature Unit To",
|
|
507
|
+
"type": "string",
|
|
508
|
+
"condition": {
|
|
509
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)') && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].meter.hide_temperature);"
|
|
510
|
+
},
|
|
511
|
+
"oneOf": [
|
|
512
|
+
{
|
|
513
|
+
"title": "Celsius",
|
|
514
|
+
"enum": [
|
|
515
|
+
"CELSIUS"
|
|
516
|
+
]
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"title": "Fahrenheit",
|
|
520
|
+
"enum": [
|
|
521
|
+
"FAHRENHEIT"
|
|
522
|
+
]
|
|
523
|
+
}
|
|
524
|
+
]
|
|
525
|
+
},
|
|
484
526
|
"hide_humidity": {
|
|
485
527
|
"title": "Hide Meter's Humidity Sensor",
|
|
486
528
|
"type": "boolean",
|
|
487
529
|
"condition": {
|
|
488
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)'
|
|
530
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)') && model.options.devices[arrayIndices].deviceId);"
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
"iosensor": {
|
|
536
|
+
"type": "object",
|
|
537
|
+
"properties": {
|
|
538
|
+
"hide_temperature": {
|
|
539
|
+
"title": "Hide Indoor/Outdoor's Temperature Sensor",
|
|
540
|
+
"type": "boolean",
|
|
541
|
+
"condition": {
|
|
542
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' && model.options.devices[arrayIndices].deviceId);"
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
"convertUnitTo": {
|
|
546
|
+
"title": "Convert Indoor/Outdoor Sensor's Temperature Unit To",
|
|
547
|
+
"type": "string",
|
|
548
|
+
"condition": {
|
|
549
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].iosensor.hide_temperature);"
|
|
550
|
+
},
|
|
551
|
+
"oneOf": [
|
|
552
|
+
{
|
|
553
|
+
"title": "Celsius",
|
|
554
|
+
"enum": [
|
|
555
|
+
"CELSIUS"
|
|
556
|
+
]
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
"title": "Fahrenheit",
|
|
560
|
+
"enum": [
|
|
561
|
+
"FAHRENHEIT"
|
|
562
|
+
]
|
|
563
|
+
}
|
|
564
|
+
]
|
|
565
|
+
},
|
|
566
|
+
"hide_humidity": {
|
|
567
|
+
"title": "Hide Indoor/Outdoor's Humidity Sensor",
|
|
568
|
+
"type": "boolean",
|
|
569
|
+
"condition": {
|
|
570
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' && model.options.devices[arrayIndices].deviceId);"
|
|
489
571
|
}
|
|
490
572
|
}
|
|
491
573
|
}
|
|
@@ -858,6 +940,22 @@
|
|
|
858
940
|
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].deviceId && (model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Curtain3'));"
|
|
859
941
|
}
|
|
860
942
|
},
|
|
943
|
+
"maxRetries": {
|
|
944
|
+
"title": "Device Max Retries for OpenAPI",
|
|
945
|
+
"type": "number",
|
|
946
|
+
"placeholder": 5,
|
|
947
|
+
"condition": {
|
|
948
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].deviceId && (model.options.devices[arrayIndices].connectionType === 'OpenAPI' || model.options.devices[arrayIndices].connectionType === 'BLE/OpenAPI'));"
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
"delayBetweenRetries": {
|
|
952
|
+
"title": "Device Delay Between Retries for OpenAPI (In Seconds)",
|
|
953
|
+
"type": "number",
|
|
954
|
+
"placeholder": 3,
|
|
955
|
+
"condition": {
|
|
956
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].deviceId && (model.options.devices[arrayIndices].connectionType === 'OpenAPI' || model.options.devices[arrayIndices].connectionType === 'BLE/OpenAPI'));"
|
|
957
|
+
}
|
|
958
|
+
},
|
|
861
959
|
"maxRetry": {
|
|
862
960
|
"title": "Max Retries for BLE",
|
|
863
961
|
"type": "number",
|
|
@@ -900,14 +998,29 @@
|
|
|
900
998
|
"type": "string",
|
|
901
999
|
"placeholder": "1.2.8",
|
|
902
1000
|
"condition": {
|
|
903
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].deviceId);"
|
|
1001
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].configDeviceType);"
|
|
904
1002
|
}
|
|
905
1003
|
},
|
|
906
1004
|
"refreshRate": {
|
|
907
1005
|
"title": "Device Refresh Rate",
|
|
908
1006
|
"type": "number",
|
|
909
1007
|
"placeholder": 360,
|
|
910
|
-
"
|
|
1008
|
+
"condition": {
|
|
1009
|
+
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType);"
|
|
1010
|
+
}
|
|
1011
|
+
},
|
|
1012
|
+
"updateRate": {
|
|
1013
|
+
"title": "Device Update Rate",
|
|
1014
|
+
"type": "number",
|
|
1015
|
+
"placeholder": 360,
|
|
1016
|
+
"condition": {
|
|
1017
|
+
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType);"
|
|
1018
|
+
}
|
|
1019
|
+
},
|
|
1020
|
+
"pushRate": {
|
|
1021
|
+
"title": "Device Push Rate",
|
|
1022
|
+
"type": "number",
|
|
1023
|
+
"placeholder": 360,
|
|
911
1024
|
"condition": {
|
|
912
1025
|
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType);"
|
|
913
1026
|
}
|
|
@@ -916,7 +1029,7 @@
|
|
|
916
1029
|
"title": "Offline as Off",
|
|
917
1030
|
"type": "boolean",
|
|
918
1031
|
"condition": {
|
|
919
|
-
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device);"
|
|
1032
|
+
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType);"
|
|
920
1033
|
}
|
|
921
1034
|
},
|
|
922
1035
|
"external": {
|
|
@@ -1539,17 +1652,30 @@
|
|
|
1539
1652
|
"type": "string",
|
|
1540
1653
|
"placeholder": "http://${FQDN}:${PORT}/${PATH}"
|
|
1541
1654
|
},
|
|
1655
|
+
"maxRetries": {
|
|
1656
|
+
"title": "Max Retries for OpenAPI",
|
|
1657
|
+
"type": "number",
|
|
1658
|
+
"placeholder": 5
|
|
1659
|
+
},
|
|
1660
|
+
"delayBetweenRetries": {
|
|
1661
|
+
"title": "Delay Between Retries for OpenAPI (In Seconds)",
|
|
1662
|
+
"type": "number",
|
|
1663
|
+
"placeholder": 3
|
|
1664
|
+
},
|
|
1542
1665
|
"refreshRate": {
|
|
1543
|
-
"title": "Refresh Rate",
|
|
1666
|
+
"title": "Device Refresh Rate",
|
|
1667
|
+
"type": "number",
|
|
1668
|
+
"placeholder": 360
|
|
1669
|
+
},
|
|
1670
|
+
"updateRate": {
|
|
1671
|
+
"title": "Device Update Rate",
|
|
1544
1672
|
"type": "number",
|
|
1545
|
-
"placeholder":
|
|
1546
|
-
"description": "Indicates the number of seconds between polls of SwitchBot API."
|
|
1673
|
+
"placeholder": 5
|
|
1547
1674
|
},
|
|
1548
1675
|
"pushRate": {
|
|
1549
|
-
"title": "Push Rate",
|
|
1676
|
+
"title": "Device Push Rate",
|
|
1550
1677
|
"type": "number",
|
|
1551
|
-
"placeholder": 1
|
|
1552
|
-
"description": "Indicates the number of seconds between pushes to SwitchBot API."
|
|
1678
|
+
"placeholder": 1
|
|
1553
1679
|
},
|
|
1554
1680
|
"logging": {
|
|
1555
1681
|
"title": "Logging Setting",
|
|
@@ -1625,10 +1751,13 @@
|
|
|
1625
1751
|
"options.devices[].connectionType",
|
|
1626
1752
|
"options.devices[].webhook",
|
|
1627
1753
|
"options.devices[].hub.hide_temperature",
|
|
1754
|
+
"options.devices[].hub.convertUnitTo",
|
|
1628
1755
|
"options.devices[].hub.hide_humidity",
|
|
1629
1756
|
"options.devices[].hub.hide_lightsensor",
|
|
1630
1757
|
"options.devices[].scanDuration",
|
|
1631
1758
|
"options.devices[].disableCaching",
|
|
1759
|
+
"options.devices[].maxRetries",
|
|
1760
|
+
"options.devices[].delayBetweenRetries",
|
|
1632
1761
|
"options.devices[].maxRetry",
|
|
1633
1762
|
"options.devices[].bot.mode",
|
|
1634
1763
|
"options.devices[].bot.deviceType",
|
|
@@ -1636,7 +1765,11 @@
|
|
|
1636
1765
|
"options.devices[].bot.doublePress",
|
|
1637
1766
|
"options.devices[].bot.pushRatePress",
|
|
1638
1767
|
"options.devices[].meter.hide_temperature",
|
|
1768
|
+
"options.devices[].meter.convertUnitTo",
|
|
1639
1769
|
"options.devices[].meter.hide_humidity",
|
|
1770
|
+
"options.devices[].iosensor.hide_temperature",
|
|
1771
|
+
"options.devices[].iosensor.convertUnitTo",
|
|
1772
|
+
"options.devices[].iosensor.hide_humidity",
|
|
1640
1773
|
"options.devices[].waterdetector.hide_leak",
|
|
1641
1774
|
"options.devices[].humidifier.set_minStep",
|
|
1642
1775
|
"options.devices[].humidifier.hide_temperature",
|
|
@@ -1674,7 +1807,18 @@
|
|
|
1674
1807
|
"options.devices[].mqttPubOptions",
|
|
1675
1808
|
"options.devices[].history",
|
|
1676
1809
|
"options.devices[].firmware",
|
|
1677
|
-
|
|
1810
|
+
{
|
|
1811
|
+
"key": "options.devices[].refreshRate",
|
|
1812
|
+
"description": "<em class='primary-text'>Specifies the interval, in seconds, for retrieving the latest device status from the SwitchBot API. This interval applies only to this specific device.</em>"
|
|
1813
|
+
},
|
|
1814
|
+
{
|
|
1815
|
+
"key": "options.devices[].updateRate",
|
|
1816
|
+
"description": "<em class='primary-text'>Specifies the interval, in seconds, at which this device will request updates from the SwitchBot API while the device is in motion, for Curtain(s) and Blind Tilt(s) only.</em>"
|
|
1817
|
+
},
|
|
1818
|
+
{
|
|
1819
|
+
"key": "options.devices[].pushRate",
|
|
1820
|
+
"description": "<em class='primary-text'>Specifies the interval, in seconds, between pushes to the SwitchBot API for this specific device.</em>"
|
|
1821
|
+
},
|
|
1678
1822
|
"options.devices[].offline",
|
|
1679
1823
|
"options.devices[].external",
|
|
1680
1824
|
"options.devices[].logging"
|
|
@@ -1738,22 +1882,20 @@
|
|
|
1738
1882
|
"expanded": false,
|
|
1739
1883
|
"items": [
|
|
1740
1884
|
"options.webhookURL",
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
"helpvalue": "<h5>Refresh Rate</h5><em class='primary-text'>Refresh Rate indicates the number of seconds between polls of SwitchBot API.</em>"
|
|
1744
|
-
},
|
|
1885
|
+
"options.maxRetries",
|
|
1886
|
+
"options.delayBetweenRetries",
|
|
1745
1887
|
{
|
|
1746
1888
|
"key": "options.refreshRate",
|
|
1747
|
-
"
|
|
1748
|
-
|
|
1889
|
+
"description": "<em class='primary-text'>Specifies the interval, in seconds, for retrieving the latest device status from the SwitchBot API.</em>"
|
|
1890
|
+
},
|
|
1749
1891
|
{
|
|
1750
|
-
"
|
|
1751
|
-
"
|
|
1752
|
-
|
|
1892
|
+
"key": "options.updateRate",
|
|
1893
|
+
"description": "<em class='primary-text'>Specifies the interval, in seconds, at which devices will request updates from the SwitchBot API while in motion, for Curtain(s) and Blind Tilt(s) only.</em>"
|
|
1894
|
+
},
|
|
1753
1895
|
{
|
|
1754
1896
|
"key": "options.pushRate",
|
|
1755
|
-
"
|
|
1756
|
-
|
|
1897
|
+
"description": "<em class='primary-text'>Specifies the interval, in seconds, between pushes to the SwitchBot API.</em>"
|
|
1898
|
+
},
|
|
1757
1899
|
"options.logging"
|
|
1758
1900
|
]
|
|
1759
1901
|
}
|
|
@@ -1,89 +1,35 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { MqttClient } from 'mqtt';
|
|
3
2
|
import { Subject } from 'rxjs';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare class BlindTilt {
|
|
15
|
-
private readonly platform;
|
|
16
|
-
private accessory;
|
|
17
|
-
device: device & devicesConfig;
|
|
18
|
-
readonly api: API;
|
|
19
|
-
readonly log: Logging;
|
|
20
|
-
readonly config: SwitchBotPlatformConfig;
|
|
21
|
-
protected readonly hap: HAP;
|
|
22
|
-
batteryService: Service;
|
|
23
|
-
lightSensorService?: Service;
|
|
24
|
-
windowCoveringService: Service;
|
|
25
|
-
BatteryLevel: CharacteristicValue;
|
|
26
|
-
PositionState: CharacteristicValue;
|
|
27
|
-
TargetPosition: CharacteristicValue;
|
|
28
|
-
CurrentPosition: CharacteristicValue;
|
|
29
|
-
StatusLowBattery: CharacteristicValue;
|
|
30
|
-
FirmwareRevision: CharacteristicValue;
|
|
31
|
-
CurrentAmbientLightLevel?: CharacteristicValue;
|
|
32
|
-
TargetHorizontalTiltAngle: CharacteristicValue;
|
|
33
|
-
CurrentHorizontalTiltAngle: CharacteristicValue;
|
|
34
|
-
OpenAPI_InMotion: deviceStatus['moving'];
|
|
35
|
-
OpenAPI_BatteryLevel: serviceData['battery'];
|
|
36
|
-
OpenAPI_Direction: deviceStatus['direction'];
|
|
37
|
-
OpenAPI_Calibration: serviceData['calibration'];
|
|
38
|
-
OpenAPI_CurrentPosition: serviceData['position'];
|
|
39
|
-
OpenAPI_FirmwareRevision: deviceStatus['version'];
|
|
40
|
-
OpenAPI_CurrentAmbientLightLevel: deviceStatus['brightness'];
|
|
41
|
-
Mode: string;
|
|
42
|
-
setPositionMode?: string | number;
|
|
3
|
+
import { deviceBase } from './device.js';
|
|
4
|
+
import { BlindTiltMappingMode } from '../utils.js';
|
|
5
|
+
import type { SwitchBotPlatform } from '../platform.js';
|
|
6
|
+
import type { PlatformAccessory, CharacteristicValue } from 'homebridge';
|
|
7
|
+
import type { device, devicesConfig, serviceData, deviceStatus } from '../settings.js';
|
|
8
|
+
export declare class BlindTilt extends deviceBase {
|
|
9
|
+
readonly platform: SwitchBotPlatform;
|
|
10
|
+
private WindowCovering;
|
|
11
|
+
private Battery;
|
|
12
|
+
private LightSensor?;
|
|
43
13
|
mappingMode: BlindTiltMappingMode;
|
|
44
|
-
BLE_InMotion: serviceData['inMotion'];
|
|
45
|
-
BLE_BatteryLevel: serviceData['battery'];
|
|
46
|
-
BLE_Calibration: serviceData['calibration'];
|
|
47
|
-
BLE_CurrentPosition: serviceData['position'];
|
|
48
|
-
BLE_CurrentAmbientLightLevel: serviceData['lightLevel'];
|
|
49
|
-
BLE_IsConnected?: boolean;
|
|
50
|
-
spaceBetweenLevels: number;
|
|
51
14
|
setNewTarget: boolean;
|
|
52
15
|
setNewTargetTimer: NodeJS.Timeout;
|
|
53
|
-
mqttClient: MqttClient | null;
|
|
54
|
-
set_minStep: number;
|
|
55
|
-
updateRate: number;
|
|
56
|
-
set_minLux: number;
|
|
57
|
-
set_maxLux: number;
|
|
58
|
-
scanDuration: number;
|
|
59
|
-
deviceLogging: string;
|
|
60
|
-
deviceRefreshRate: number;
|
|
61
|
-
setCloseMode: string;
|
|
62
|
-
setOpenMode: string;
|
|
63
16
|
blindTiltUpdateInProgress: boolean;
|
|
64
17
|
doBlindTiltUpdate: Subject<void>;
|
|
65
|
-
private readonly OpenAPI;
|
|
66
|
-
private readonly BLE;
|
|
67
18
|
constructor(platform: SwitchBotPlatform, accessory: PlatformAccessory, device: device & devicesConfig);
|
|
68
19
|
/**
|
|
69
|
-
* Parse the device status from the
|
|
20
|
+
* Parse the device status from the SwitchBotBLE API
|
|
21
|
+
*/
|
|
22
|
+
BLEparseStatus(serviceData: serviceData): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Parse the device status from the SwitchBot OpenAPI
|
|
70
25
|
*/
|
|
71
|
-
|
|
72
|
-
BLEparseStatus(): Promise<void>;
|
|
73
|
-
openAPIparseStatus(): Promise<void>;
|
|
26
|
+
openAPIparseStatus(deviceStatus: deviceStatus): Promise<void>;
|
|
74
27
|
refreshStatus(): Promise<void>;
|
|
75
28
|
BLERefreshStatus(): Promise<void>;
|
|
76
29
|
openAPIRefreshStatus(): Promise<void>;
|
|
30
|
+
registerWebhook(accessory: PlatformAccessory, device: device & devicesConfig): Promise<void>;
|
|
77
31
|
pushChanges(): Promise<void>;
|
|
78
32
|
BLEpushChanges(): Promise<void>;
|
|
79
|
-
retry({ max, fn }: {
|
|
80
|
-
max: number;
|
|
81
|
-
fn: {
|
|
82
|
-
(): any;
|
|
83
|
-
(): Promise<any>;
|
|
84
|
-
};
|
|
85
|
-
}): Promise<null>;
|
|
86
|
-
maxRetry(): number;
|
|
87
33
|
openAPIpushChanges(): Promise<void>;
|
|
88
34
|
/**
|
|
89
35
|
* Handle requests to set the value of the "Target Horizontal Tilt" characteristic
|
|
@@ -95,22 +41,15 @@ export declare class BlindTilt {
|
|
|
95
41
|
TargetPositionSet(value: CharacteristicValue): Promise<void>;
|
|
96
42
|
startUpdatingBlindTiltIfNeeded(): Promise<void>;
|
|
97
43
|
updateHomeKitCharacteristics(): Promise<void>;
|
|
98
|
-
mqttPublish(topic: string, message: any): void;
|
|
99
|
-
setupMqtt(device: device & devicesConfig): Promise<void>;
|
|
100
|
-
stopScanning(switchbot: any): Promise<void>;
|
|
101
|
-
getCustomBLEAddress(switchbot: any): Promise<void>;
|
|
102
44
|
BLEPushConnection(): Promise<void>;
|
|
103
45
|
BLERefreshConnection(switchbot: any): Promise<void>;
|
|
104
|
-
|
|
46
|
+
setPerformance(): Promise<{
|
|
47
|
+
setPositionMode: number;
|
|
48
|
+
Mode: string;
|
|
49
|
+
}>;
|
|
105
50
|
setMinMax(): Promise<void>;
|
|
106
|
-
minStep(device: device & devicesConfig): number;
|
|
107
|
-
minLux(): number;
|
|
108
|
-
maxLux(): number;
|
|
109
|
-
scan(device: device & devicesConfig): Promise<void>;
|
|
110
|
-
statusCode(statusCode: number): Promise<void>;
|
|
111
51
|
offlineOff(): Promise<void>;
|
|
112
52
|
apiError(e: any): Promise<void>;
|
|
113
|
-
deviceContext(): Promise<void>;
|
|
114
53
|
/**
|
|
115
54
|
* Maps device values to homekit values
|
|
116
55
|
*
|
|
@@ -127,19 +66,5 @@ export declare class BlindTilt {
|
|
|
127
66
|
* @returns [device position, device direction]
|
|
128
67
|
*/
|
|
129
68
|
mapHomekitValuesToDeviceValues(homekitPosition: number, homekitTiltAngle: number): [string, number];
|
|
130
|
-
refreshRate(device: device & devicesConfig): Promise<void>;
|
|
131
|
-
deviceConfig(device: device & devicesConfig): Promise<void>;
|
|
132
|
-
deviceLogs(device: device & devicesConfig): Promise<void>;
|
|
133
|
-
/**
|
|
134
|
-
* Logging for Device
|
|
135
|
-
*/
|
|
136
|
-
infoLog(...log: any[]): void;
|
|
137
|
-
warnLog(...log: any[]): void;
|
|
138
|
-
debugWarnLog(...log: any[]): void;
|
|
139
|
-
errorLog(...log: any[]): void;
|
|
140
|
-
debugErrorLog(...log: any[]): void;
|
|
141
|
-
debugLog(...log: any[]): void;
|
|
142
|
-
enablingDeviceLogging(): boolean;
|
|
143
69
|
}
|
|
144
|
-
export {};
|
|
145
70
|
//# sourceMappingURL=blindtilt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blindtilt.d.ts","sourceRoot":"","sources":["../../src/device/blindtilt.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"blindtilt.d.ts","sourceRoot":"","sources":["../../src/device/blindtilt.ts"],"names":[],"mappings":";AAMA,OAAO,EAAY,OAAO,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAClF,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGvF,qBAAa,SAAU,SAAQ,UAAU;IAsCrC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB;IApCtC,OAAO,CAAC,cAAc,CAQpB;IAEF,OAAO,CAAC,OAAO,CAMb;IAEF,OAAO,CAAC,WAAW,CAAC,CAIlB;IAGF,WAAW,EAAE,oBAAoB,CAA+B;IAGhE,YAAY,EAAG,OAAO,CAAC;IACvB,iBAAiB,EAAG,MAAM,CAAC,OAAO,CAAC;IAGnC,yBAAyB,EAAG,OAAO,CAAC;IACpC,iBAAiB,EAAG,OAAO,CAAC,IAAI,CAAC,CAAC;gBAGvB,QAAQ,EAAE,iBAAiB,EACpC,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,MAAM,GAAG,aAAa;IAyKhC;;OAEG;IACG,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA6G7D;;OAEG;IACG,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IA4G7D,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAc9B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAqCjC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAyBrC,eAAe,CAAC,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa;IA2B5E,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAqB5B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IA6C/B,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAmEzC;;OAEG;IACG,4BAA4B,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB7E;;OAEG;IACG,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAc5D,8BAA8B,IAAI,OAAO,CAAC,IAAI,CAAC;IAsC/C,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC;IA0G7C,iBAAiB;IAOjB,oBAAoB,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IASnD,cAAc;;;;IA6Bd,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB1B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAU3B,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAerC;;;;;;OAMG;IACH,8BAA8B,CAAC,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;IAgD5H;;;;;;OAMG;IACH,8BAA8B,CAAC,eAAe,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;CAyDpG"}
|