@switchbot/homebridge-switchbot 3.5.0-beta.5 → 3.5.0-beta.51
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/CHANGELOG.md +2 -0
- package/config.schema.json +120 -17
- package/dist/device/blindtilt.d.ts +21 -94
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +352 -757
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts +25 -71
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +588 -761
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts +13 -67
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +214 -588
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts +13 -74
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +256 -634
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts +14 -65
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +209 -532
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +17 -86
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +340 -787
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/device.d.ts +59 -0
- package/dist/device/device.d.ts.map +1 -0
- package/dist/device/device.js +682 -0
- package/dist/device/device.js.map +1 -0
- package/dist/device/fan.d.ts +51 -0
- package/dist/device/fan.d.ts.map +1 -0
- package/dist/device/fan.js +505 -0
- package/dist/device/fan.js.map +1 -0
- package/dist/device/hub.d.ts +15 -59
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +247 -597
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts +10 -65
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +218 -579
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts +11 -64
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +179 -585
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts +10 -68
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +257 -569
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts +15 -62
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +215 -543
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts +13 -63
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +175 -578
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts +13 -64
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +164 -578
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts +13 -69
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +142 -520
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts +9 -57
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +87 -453
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts +11 -62
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +145 -452
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/waterdetector.d.ts +9 -70
- package/dist/device/waterdetector.d.ts.map +1 -1
- package/dist/device/waterdetector.js +126 -665
- package/dist/device/waterdetector.js.map +1 -1
- package/dist/homebridge-ui/public/index.html +2 -2
- package/dist/index.js +1 -1
- package/dist/irdevice/airconditioner.d.ts +8 -48
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +309 -419
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts +7 -38
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +72 -304
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts +6 -35
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +34 -278
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts +6 -39
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +67 -311
- 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 +512 -0
- package/dist/irdevice/irdevice.js.map +1 -0
- package/dist/irdevice/light.d.ts +6 -34
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +23 -272
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts +18 -47
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +352 -546
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts +7 -39
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +82 -321
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts +6 -35
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +41 -284
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts +6 -35
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +42 -287
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts +14 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +291 -147
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +41 -11
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +0 -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 +87 -0
- package/package.json +16 -15
- package/src/custom.d.ts +2 -1
- package/src/device/blindtilt.ts +378 -783
- package/src/device/bot.ts +621 -845
- package/src/device/ceilinglight.ts +227 -608
- package/src/device/colorbulb.ts +269 -657
- package/src/device/contact.ts +235 -555
- package/src/device/curtain.ts +360 -811
- package/src/device/device.ts +710 -0
- package/src/device/fan.ts +554 -0
- package/src/device/hub.ts +274 -625
- package/src/device/humidifier.ts +246 -624
- package/src/device/iosensor.ts +205 -611
- package/src/device/lightstrip.ts +278 -597
- package/src/device/lock.ts +252 -583
- package/src/device/meter.ts +200 -601
- package/src/device/meterplus.ts +189 -603
- package/src/device/motion.ts +161 -542
- package/src/device/plug.ts +97 -481
- package/src/device/robotvacuumcleaner.ts +166 -478
- package/src/device/waterdetector.ts +143 -689
- package/src/homebridge-ui/public/index.html +2 -2
- package/src/index.ts +1 -1
- package/src/irdevice/airconditioner.ts +330 -446
- package/src/irdevice/airpurifier.ts +89 -321
- package/src/irdevice/camera.ts +42 -293
- package/src/irdevice/fan.ts +78 -327
- package/src/irdevice/irdevice.ts +528 -0
- package/src/irdevice/light.ts +32 -287
- package/src/irdevice/other.ts +396 -615
- package/src/irdevice/tv.ts +100 -339
- package/src/irdevice/vacuumcleaner.ts +49 -305
- package/src/irdevice/waterheater.ts +50 -310
- package/src/platform.ts +301 -155
- package/src/settings.ts +57 -566
- package/src/utils.ts +642 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,8 +6,10 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
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)
|
|
11
13
|
- Housekeeping and updated dependencies.
|
|
12
14
|
|
|
13
15
|
**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,37 +499,84 @@
|
|
|
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);"
|
|
489
531
|
}
|
|
490
532
|
}
|
|
491
533
|
}
|
|
492
534
|
},
|
|
493
|
-
"
|
|
535
|
+
"iosensor": {
|
|
494
536
|
"type": "object",
|
|
495
537
|
"properties": {
|
|
496
|
-
"
|
|
497
|
-
"title": "Hide
|
|
538
|
+
"hide_temperature": {
|
|
539
|
+
"title": "Hide Indoor/Outdoor's Temperature Sensor",
|
|
498
540
|
"type": "boolean",
|
|
499
541
|
"condition": {
|
|
500
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === '
|
|
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);"
|
|
501
543
|
}
|
|
502
544
|
},
|
|
503
|
-
"
|
|
504
|
-
"title": "
|
|
505
|
-
"type": "
|
|
545
|
+
"convertUnitTo": {
|
|
546
|
+
"title": "Convert Indoor/Outdoor Sensor's Temperature Unit To",
|
|
547
|
+
"type": "string",
|
|
506
548
|
"condition": {
|
|
507
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === '
|
|
508
|
-
}
|
|
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
|
+
]
|
|
509
565
|
},
|
|
510
566
|
"hide_humidity": {
|
|
511
|
-
"title": "Hide
|
|
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);"
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
"waterdetector": {
|
|
576
|
+
"type": "object",
|
|
577
|
+
"properties": {
|
|
578
|
+
"hide_leak": {
|
|
579
|
+
"title": "Hide Water Detector's Leak Sensor",
|
|
512
580
|
"type": "boolean",
|
|
513
581
|
"condition": {
|
|
514
582
|
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Water Detector' && model.options.devices[arrayIndices].deviceId);"
|
|
@@ -872,6 +940,22 @@
|
|
|
872
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'));"
|
|
873
941
|
}
|
|
874
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
|
+
},
|
|
875
959
|
"maxRetry": {
|
|
876
960
|
"title": "Max Retries for BLE",
|
|
877
961
|
"type": "number",
|
|
@@ -1553,6 +1637,16 @@
|
|
|
1553
1637
|
"type": "string",
|
|
1554
1638
|
"placeholder": "http://${FQDN}:${PORT}/${PATH}"
|
|
1555
1639
|
},
|
|
1640
|
+
"maxRetries": {
|
|
1641
|
+
"title": "Max Retries for OpenAPI",
|
|
1642
|
+
"type": "number",
|
|
1643
|
+
"placeholder": 5
|
|
1644
|
+
},
|
|
1645
|
+
"delayBetweenRetries": {
|
|
1646
|
+
"title": "Delay Between Retries for OpenAPI (In Seconds)",
|
|
1647
|
+
"type": "number",
|
|
1648
|
+
"placeholder": 3
|
|
1649
|
+
},
|
|
1556
1650
|
"refreshRate": {
|
|
1557
1651
|
"title": "Refresh Rate",
|
|
1558
1652
|
"type": "number",
|
|
@@ -1629,7 +1723,8 @@
|
|
|
1629
1723
|
"title": "{{ value.configDeviceName || value.deviceId || 'New SwitchBot Device' }}",
|
|
1630
1724
|
"expandable": true,
|
|
1631
1725
|
"expanded": false,
|
|
1632
|
-
"
|
|
1726
|
+
"draggable": true,
|
|
1727
|
+
"orderable": true,
|
|
1633
1728
|
"items": [
|
|
1634
1729
|
"options.devices[].configDeviceName",
|
|
1635
1730
|
"options.devices[].deviceId",
|
|
@@ -1638,10 +1733,13 @@
|
|
|
1638
1733
|
"options.devices[].connectionType",
|
|
1639
1734
|
"options.devices[].webhook",
|
|
1640
1735
|
"options.devices[].hub.hide_temperature",
|
|
1736
|
+
"options.devices[].hub.convertUnitTo",
|
|
1641
1737
|
"options.devices[].hub.hide_humidity",
|
|
1642
1738
|
"options.devices[].hub.hide_lightsensor",
|
|
1643
1739
|
"options.devices[].scanDuration",
|
|
1644
1740
|
"options.devices[].disableCaching",
|
|
1741
|
+
"options.devices[].maxRetries",
|
|
1742
|
+
"options.devices[].delayBetweenRetries",
|
|
1645
1743
|
"options.devices[].maxRetry",
|
|
1646
1744
|
"options.devices[].bot.mode",
|
|
1647
1745
|
"options.devices[].bot.deviceType",
|
|
@@ -1649,10 +1747,12 @@
|
|
|
1649
1747
|
"options.devices[].bot.doublePress",
|
|
1650
1748
|
"options.devices[].bot.pushRatePress",
|
|
1651
1749
|
"options.devices[].meter.hide_temperature",
|
|
1750
|
+
"options.devices[].meter.convertUnitTo",
|
|
1652
1751
|
"options.devices[].meter.hide_humidity",
|
|
1752
|
+
"options.devices[].iosensor.hide_temperature",
|
|
1753
|
+
"options.devices[].iosensor.convertUnitTo",
|
|
1754
|
+
"options.devices[].iosensor.hide_humidity",
|
|
1653
1755
|
"options.devices[].waterdetector.hide_leak",
|
|
1654
|
-
"options.devices[].waterdetector.hide_temperature",
|
|
1655
|
-
"options.devices[].waterdetector.hide_humidity",
|
|
1656
1756
|
"options.devices[].humidifier.set_minStep",
|
|
1657
1757
|
"options.devices[].humidifier.hide_temperature",
|
|
1658
1758
|
"options.devices[].curtain.set_minStep",
|
|
@@ -1710,7 +1810,8 @@
|
|
|
1710
1810
|
"title": "{{ value.configDeviceName || value.deviceId || 'New IR Device' }}",
|
|
1711
1811
|
"expandable": true,
|
|
1712
1812
|
"expanded": false,
|
|
1713
|
-
"
|
|
1813
|
+
"draggable": true,
|
|
1814
|
+
"orderable": true,
|
|
1714
1815
|
"items": [
|
|
1715
1816
|
"options.irdevices[].configDeviceName",
|
|
1716
1817
|
"options.irdevices[].deviceId",
|
|
@@ -1752,6 +1853,8 @@
|
|
|
1752
1853
|
"expanded": false,
|
|
1753
1854
|
"items": [
|
|
1754
1855
|
"options.webhookURL",
|
|
1856
|
+
"options.maxRetries",
|
|
1857
|
+
"options.delayBetweenRetries",
|
|
1755
1858
|
{
|
|
1756
1859
|
"type": "help",
|
|
1757
1860
|
"helpvalue": "<h5>Refresh Rate</h5><em class='primary-text'>Refresh Rate indicates the number of seconds between polls of SwitchBot API.</em>"
|
|
@@ -1,89 +1,34 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import {
|
|
2
|
+
import { BlindTiltMappingMode } from '../utils.js';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
|
+
import { deviceBase } from './device.js';
|
|
4
5
|
import { SwitchBotPlatform } from '../platform.js';
|
|
5
|
-
import {
|
|
6
|
-
import { device, devicesConfig, serviceData, deviceStatus
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
UseTiltForDirection = "use_tilt_for_direction"
|
|
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;
|
|
6
|
+
import { PlatformAccessory, CharacteristicValue } from 'homebridge';
|
|
7
|
+
import { 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>;
|
|
77
30
|
pushChanges(): Promise<void>;
|
|
78
31
|
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
32
|
openAPIpushChanges(): Promise<void>;
|
|
88
33
|
/**
|
|
89
34
|
* Handle requests to set the value of the "Target Horizontal Tilt" characteristic
|
|
@@ -95,22 +40,18 @@ export declare class BlindTilt {
|
|
|
95
40
|
TargetPositionSet(value: CharacteristicValue): Promise<void>;
|
|
96
41
|
startUpdatingBlindTiltIfNeeded(): Promise<void>;
|
|
97
42
|
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
43
|
BLEPushConnection(): Promise<void>;
|
|
103
44
|
BLERefreshConnection(switchbot: any): Promise<void>;
|
|
104
|
-
|
|
45
|
+
setPerformance(): Promise<{
|
|
46
|
+
setPositionMode: number;
|
|
47
|
+
Mode: string;
|
|
48
|
+
}>;
|
|
105
49
|
setMinMax(): Promise<void>;
|
|
106
50
|
minStep(device: device & devicesConfig): number;
|
|
107
|
-
minLux(): number
|
|
108
|
-
maxLux(): number
|
|
109
|
-
scan(device: device & devicesConfig): Promise<void>;
|
|
110
|
-
statusCode(statusCode: number): Promise<void>;
|
|
51
|
+
minLux(): Promise<number>;
|
|
52
|
+
maxLux(): Promise<number>;
|
|
111
53
|
offlineOff(): Promise<void>;
|
|
112
54
|
apiError(e: any): Promise<void>;
|
|
113
|
-
deviceContext(): Promise<void>;
|
|
114
55
|
/**
|
|
115
56
|
* Maps device values to homekit values
|
|
116
57
|
*
|
|
@@ -127,19 +68,5 @@ export declare class BlindTilt {
|
|
|
127
68
|
* @returns [device position, device direction]
|
|
128
69
|
*/
|
|
129
70
|
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
71
|
}
|
|
144
|
-
export {};
|
|
145
72
|
//# 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":";AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAY,OAAO,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAW,MAAM,gBAAgB,CAAC;AAG3F,qBAAa,SAAU,SAAQ,UAAU;IAkCrC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB;IAhCtC,OAAO,CAAC,cAAc,CAOpB;IAEF,OAAO,CAAC,OAAO,CAIb;IAEF,OAAO,CAAC,WAAW,CAAC,CAGlB;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;IA6KhC;;OAEG;IACG,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAmH7D;;OAEG;IACG,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IA0G7D,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB9B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAqCjC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IA2BrC,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAsB5B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAiD/B,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAqEzC;;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;IA4C/C,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC;IAkG7C,iBAAiB;IAOjB,oBAAoB,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IASnD,cAAc;;;;IA6Bd,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBhC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,MAAM;IAUzC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAUzB,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAUzB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ3B,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAcrC;;;;;;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"}
|