homebridge-easy-mqtt 1.4.0-beta.17 → 1.4.0-beta.18
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 +10 -2
- package/README.md +23 -0
- package/config.schema.json +360 -2
- package/dist/accessory/abstract/helper.js +3 -0
- package/dist/accessory/abstract/helper.js.map +1 -1
- package/dist/accessory/position/blind.d.ts +10 -0
- package/dist/accessory/position/blind.js +22 -0
- package/dist/accessory/position/blind.js.map +1 -0
- package/dist/accessory/position/position.d.ts +14 -0
- package/dist/accessory/position/position.js +80 -0
- package/dist/accessory/position/position.js.map +1 -0
- package/dist/homebridge-ui/public/index.html +1 -1
- package/dist/homebridge-ui/public/ui.js +1 -1
- package/dist/i18n/en.d.ts +42 -0
- package/dist/i18n/en.js +42 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/fr.d.ts +42 -0
- package/dist/i18n/i18n.d.ts +42 -0
- package/dist/i18n/ro.d.ts +42 -0
- package/dist/i18n/template.d.ts +42 -0
- package/dist/model/enums.d.ts +10 -1
- package/dist/model/enums.js +9 -0
- package/dist/model/enums.js.map +1 -1
- package/dist/model/types.d.ts +22 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to homebridge-dummy will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## 1.4.0-beta.
|
|
5
|
+
## 1.4.0-beta.18 (2025-09-30)
|
|
6
6
|
|
|
7
7
|
### Added
|
|
8
|
-
-
|
|
8
|
+
- A bunch of new accessory types:
|
|
9
|
+
- `Air Purifier`
|
|
10
|
+
- `Air Quality Sensor`
|
|
11
|
+
- `Fanv2`
|
|
12
|
+
- `GarageDoorOpener`
|
|
13
|
+
- `HeaterCooler`
|
|
14
|
+
- `LightSensor`
|
|
15
|
+
- `Valve`
|
|
16
|
+
- `Window Covering`
|
|
9
17
|
- Broker, username, and password can be set via environment variables ([documentation](https://github.com/mpatfield/homebridge-easy-mqtt#environment-variables))
|
|
10
18
|
- Publish arbitrary MQTT messages on connect ([documentation] (https://github.com/mpatfield/homebridge-easy-mqtt#mqtt-onconnect))
|
|
11
19
|
- Traduceri în limba română. Mulțumesc, [@rursache](https://github.com/sponsors/rursache)!
|
package/README.md
CHANGED
|
@@ -47,6 +47,7 @@ This plugin is designed to be a simple replacement for the fantastic [homebridge
|
|
|
47
47
|
- `TemperatureSensor`
|
|
48
48
|
- `Thermostat`
|
|
49
49
|
- `Valve`
|
|
50
|
+
- `WindowCovering`
|
|
50
51
|
|
|
51
52
|
## Configuration
|
|
52
53
|
|
|
@@ -175,6 +176,28 @@ These values are used for both determining current state and, where appropriate,
|
|
|
175
176
|
- `valueOn*` - Turned on, e.g. "true", or "1", or "On"
|
|
176
177
|
- `valueOff*` - Turned off, e.g. "false", or "0", or "Off"
|
|
177
178
|
|
|
179
|
+
### Position Accessories
|
|
180
|
+
|
|
181
|
+
#### WindowCovering
|
|
182
|
+
- `topicGetPositionState*` - Get position state (Decreasing, Increasing, Stopped)
|
|
183
|
+
- `topicGetCurrentPosition*` - Get current position percent
|
|
184
|
+
- `topicGetTargetPosition*` - Get target position percent
|
|
185
|
+
- `topicSetTargetPosition*` - Set target position percent
|
|
186
|
+
- `topicGetCurrentHorizontalTiltAngle` - Get current horizontal angle (-90° to 90°)
|
|
187
|
+
- `topicGetTargetHorizontalTiltAngle` - Get target horizontal angle (-90° to 90°)
|
|
188
|
+
- `topicSetTargetHorizontalTiltAngle` - Set target horizontal angle (-90° to 90°)
|
|
189
|
+
- `topicGetCurrentVerticalTiltAngle` - Get current vertical angle (-90° to 90°)
|
|
190
|
+
- `topicGetTargetVerticalTiltAngle` - Get target vertical angle (-90° to 90°)
|
|
191
|
+
- `topicSetTargetVerticalTiltAngle` - Set target vertical angle (-90° to 90°)
|
|
192
|
+
- `topicSetHoldPosition` - Set hold (true/false)
|
|
193
|
+
- `topicGetObstructionDetected` - Get obstruction detected
|
|
194
|
+
- `valuePositionDecreasing` - Closing
|
|
195
|
+
- `valuePositionIncreasing` - Opening
|
|
196
|
+
- `valuePositionStopped` - Stopped
|
|
197
|
+
- `valuePositionHold` - Hold
|
|
198
|
+
- `valuePositionResume` - Resume
|
|
199
|
+
- `valuePositionObstructed` - Obstruction detected
|
|
200
|
+
|
|
178
201
|
### Sensors
|
|
179
202
|
|
|
180
203
|
#### AirQualitySensor
|
package/config.schema.json
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"type": {
|
|
22
22
|
"type": "string",
|
|
23
23
|
"title": "${config.title.type}",
|
|
24
|
-
"enum": [ "AirPurifier", "AirQualitySensor", "CarbonMonoxideSensor", "CarbonDioxideSensor", "ContactSensor", "Fanv2", "GarageDoorOpener", "HeaterCooler", "HumiditySensor", "LeakSensor", "Lightbulb", "LightSensor", "LockMechanism", "MotionSensor", "OccupancySensor", "Outlet", "SecuritySystem", "SmokeSensor", "Switch", "TemperatureSensor", "Thermostat", "Valve"],
|
|
25
|
-
"enumNames": ["${config.enumNames.airPurifier}", "${config.enumNames.airQualitySensor}", "${config.enumNames.carbonMonoxideSensor}", "${config.enumNames.carbonDioxideSensor}", "${config.enumNames.contactSensor}", "${config.enumNames.fanv2}", "${config.enumNames.garageDoorOpener}", "${config.enumNames.heaterCooler}", "${config.enumNames.humiditySensor}", "${config.enumNames.leakSensor}", "${config.enumNames.lightbulb}", "${config.enumNames.lightSensor}", "${config.enumNames.lockMechanism}", "${config.enumNames.motionSensor}", "${config.enumNames.occupancySensor}", "${config.enumNames.outlet}", "${config.enumNames.securitySystem}", "${config.enumNames.smokeSensor}", "${config.enumNames.switch}", "${config.enumNames.temperatureSensor}", "${config.enumNames.thermostat}", "${config.enumNames.valve}"],
|
|
24
|
+
"enum": [ "AirPurifier", "AirQualitySensor", "CarbonMonoxideSensor", "CarbonDioxideSensor", "ContactSensor", "Fanv2", "GarageDoorOpener", "HeaterCooler", "HumiditySensor", "LeakSensor", "Lightbulb", "LightSensor", "LockMechanism", "MotionSensor", "OccupancySensor", "Outlet", "SecuritySystem", "SmokeSensor", "Switch", "TemperatureSensor", "Thermostat", "Valve", "WindowCovering"],
|
|
25
|
+
"enumNames": ["${config.enumNames.airPurifier}", "${config.enumNames.airQualitySensor}", "${config.enumNames.carbonMonoxideSensor}", "${config.enumNames.carbonDioxideSensor}", "${config.enumNames.contactSensor}", "${config.enumNames.fanv2}", "${config.enumNames.garageDoorOpener}", "${config.enumNames.heaterCooler}", "${config.enumNames.humiditySensor}", "${config.enumNames.leakSensor}", "${config.enumNames.lightbulb}", "${config.enumNames.lightSensor}", "${config.enumNames.lockMechanism}", "${config.enumNames.motionSensor}", "${config.enumNames.occupancySensor}", "${config.enumNames.outlet}", "${config.enumNames.securitySystem}", "${config.enumNames.smokeSensor}", "${config.enumNames.switch}", "${config.enumNames.temperatureSensor}", "${config.enumNames.thermostat}", "${config.enumNames.valve}", "${config.enumNames.windowCovering}"],
|
|
26
26
|
"required": true
|
|
27
27
|
},
|
|
28
28
|
"group": {
|
|
@@ -486,6 +486,50 @@
|
|
|
486
486
|
"type": "string",
|
|
487
487
|
"title": "${config.title.topicGetVOCDensity}"
|
|
488
488
|
},
|
|
489
|
+
"topicGetCurrentPosition": {
|
|
490
|
+
"type": "string",
|
|
491
|
+
"title": "${config.title.topicGetCurrentPosition}"
|
|
492
|
+
},
|
|
493
|
+
"topicSetHoldPosition": {
|
|
494
|
+
"type": "string",
|
|
495
|
+
"title": "${config.title.topicSetHoldPosition}"
|
|
496
|
+
},
|
|
497
|
+
"topicGetPositionState": {
|
|
498
|
+
"type": "string",
|
|
499
|
+
"title": "${config.title.topicGetPositionState}"
|
|
500
|
+
},
|
|
501
|
+
"topicGetTargetPosition": {
|
|
502
|
+
"type": "string",
|
|
503
|
+
"title": "${config.title.topicGetTargetPosition}"
|
|
504
|
+
},
|
|
505
|
+
"topicSetTargetPosition": {
|
|
506
|
+
"type": "string",
|
|
507
|
+
"title": "${config.title.topicSetTargetPosition}"
|
|
508
|
+
},
|
|
509
|
+
"topicGetCurrentHorizontalTiltAngle": {
|
|
510
|
+
"type": "string",
|
|
511
|
+
"title": "${config.title.topicGetCurrentHorizontalTiltAngle}"
|
|
512
|
+
},
|
|
513
|
+
"topicGetCurrentVerticalTiltAngle": {
|
|
514
|
+
"type": "string",
|
|
515
|
+
"title": "${config.title.topicGetCurrentVerticalTiltAngle}"
|
|
516
|
+
},
|
|
517
|
+
"topicGetTargetHorizontalTiltAngle": {
|
|
518
|
+
"type": "string",
|
|
519
|
+
"title": "${config.title.topicGetTargetHorizontalTiltAngle}"
|
|
520
|
+
},
|
|
521
|
+
"topicGetTargetVerticalTiltAngle": {
|
|
522
|
+
"type": "string",
|
|
523
|
+
"title": "${config.title.topicGetTargetVerticalTiltAngle}"
|
|
524
|
+
},
|
|
525
|
+
"topicSetTargetHorizontalTiltAngle": {
|
|
526
|
+
"type": "string",
|
|
527
|
+
"title": "${config.title.topicSetTargetHorizontalTiltAngle}"
|
|
528
|
+
},
|
|
529
|
+
"topicSetTargetVerticalTiltAngle": {
|
|
530
|
+
"type": "string",
|
|
531
|
+
"title": "${config.title.topicSetTargetVerticalTiltAngle}"
|
|
532
|
+
},
|
|
489
533
|
"valueBatteryLow": {
|
|
490
534
|
"type": "string",
|
|
491
535
|
"title": "${config.title.valueBatteryLow}"
|
|
@@ -718,6 +762,30 @@
|
|
|
718
762
|
"type": "string",
|
|
719
763
|
"title": "${config.title.valueAQUnknown}"
|
|
720
764
|
},
|
|
765
|
+
"valuePositionHold": {
|
|
766
|
+
"type": "string",
|
|
767
|
+
"title": "${config.title.valuePositionHold}"
|
|
768
|
+
},
|
|
769
|
+
"valuePositionDecreasing": {
|
|
770
|
+
"type": "string",
|
|
771
|
+
"title": "${config.title.valuePositionDecreasing}"
|
|
772
|
+
},
|
|
773
|
+
"valuePositionIncreasing": {
|
|
774
|
+
"type": "string",
|
|
775
|
+
"title": "${config.title.valuePositionIncreasing}"
|
|
776
|
+
},
|
|
777
|
+
"valuePositionObstructed": {
|
|
778
|
+
"type": "string",
|
|
779
|
+
"title": "${config.title.valuePositionObstructed}"
|
|
780
|
+
},
|
|
781
|
+
"valuePositionResume": {
|
|
782
|
+
"type": "string",
|
|
783
|
+
"title": "${config.title.valuePositionResume}"
|
|
784
|
+
},
|
|
785
|
+
"valuePositionStopped": {
|
|
786
|
+
"type": "string",
|
|
787
|
+
"title": "${config.title.valuePositionStopped}"
|
|
788
|
+
},
|
|
721
789
|
"resetOnRestart": {
|
|
722
790
|
"type": "boolean",
|
|
723
791
|
"title": "${config.title.resetOnRestart}"
|
|
@@ -744,6 +812,27 @@
|
|
|
744
812
|
"required": ["topicGetOn", "topicSetOn", "valueOn", "valueOff"]
|
|
745
813
|
}
|
|
746
814
|
},
|
|
815
|
+
{
|
|
816
|
+
"if": {
|
|
817
|
+
"properties": {
|
|
818
|
+
"info": {
|
|
819
|
+
"properties": {
|
|
820
|
+
"type" : {
|
|
821
|
+
"enum": ["WindowCovering"]
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
"then": {
|
|
828
|
+
"required": ["topicGetCurrentPosition", "topicGetTargetPosition", "topicSetTargetPosition", "topicGetPositionState"],
|
|
829
|
+
"anyOf": [
|
|
830
|
+
{ "required": ["valuePositionDecreasing"] },
|
|
831
|
+
{ "required": ["valuePositionIncreasing"] },
|
|
832
|
+
{ "required": ["valuePositionStopped"] }
|
|
833
|
+
]
|
|
834
|
+
}
|
|
835
|
+
},
|
|
747
836
|
{
|
|
748
837
|
"if": {
|
|
749
838
|
"properties": {
|
|
@@ -1413,6 +1502,84 @@
|
|
|
1413
1502
|
"then": {
|
|
1414
1503
|
"required": ["topicGetRotationDirection"]
|
|
1415
1504
|
}
|
|
1505
|
+
},
|
|
1506
|
+
{
|
|
1507
|
+
"if": {
|
|
1508
|
+
"properties": {
|
|
1509
|
+
"topicSetHoldPosition": {
|
|
1510
|
+
"minLength": 1
|
|
1511
|
+
}
|
|
1512
|
+
},
|
|
1513
|
+
"required": ["topicSetHoldPosition"]
|
|
1514
|
+
},
|
|
1515
|
+
"then": {
|
|
1516
|
+
"required": ["valuePositionHold", "valuePositionResume"]
|
|
1517
|
+
}
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
"if": {
|
|
1521
|
+
"properties": {
|
|
1522
|
+
"topicGetObstructionDetected": {
|
|
1523
|
+
"minLength": 1
|
|
1524
|
+
}
|
|
1525
|
+
},
|
|
1526
|
+
"required": ["topicGetObstructionDetected"]
|
|
1527
|
+
},
|
|
1528
|
+
"then": {
|
|
1529
|
+
"required": ["valuePositionObstructed"]
|
|
1530
|
+
}
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
"if": {
|
|
1534
|
+
"properties": {
|
|
1535
|
+
"topicGetCurrentHorizontalTiltAngle": {
|
|
1536
|
+
"minLength": 1
|
|
1537
|
+
}
|
|
1538
|
+
},
|
|
1539
|
+
"required": ["topicGetCurrentHorizontalTiltAngle"]
|
|
1540
|
+
},
|
|
1541
|
+
"then": {
|
|
1542
|
+
"required": ["topicGetTargetHorizontalTiltAngle", "topicSetTargetHorizontalTiltAngle"]
|
|
1543
|
+
}
|
|
1544
|
+
},
|
|
1545
|
+
{
|
|
1546
|
+
"if": {
|
|
1547
|
+
"properties": {
|
|
1548
|
+
"topicSetTargetHorizontalTiltAngle": {
|
|
1549
|
+
"minLength": 1
|
|
1550
|
+
}
|
|
1551
|
+
},
|
|
1552
|
+
"required": ["topicSetTargetHorizontalTiltAngle"]
|
|
1553
|
+
},
|
|
1554
|
+
"then": {
|
|
1555
|
+
"required": ["topicGetTargetHorizontalTiltAngle"]
|
|
1556
|
+
}
|
|
1557
|
+
},
|
|
1558
|
+
{
|
|
1559
|
+
"if": {
|
|
1560
|
+
"properties": {
|
|
1561
|
+
"topicGetTargetVerticalTiltAngle": {
|
|
1562
|
+
"minLength": 1
|
|
1563
|
+
}
|
|
1564
|
+
},
|
|
1565
|
+
"required": ["topicGetTargetVerticalTiltAngle"]
|
|
1566
|
+
},
|
|
1567
|
+
"then": {
|
|
1568
|
+
"required": ["topicGetCurrentVerticalTiltAngle", "topicSetTargetVerticalTiltAngle"]
|
|
1569
|
+
}
|
|
1570
|
+
},
|
|
1571
|
+
{
|
|
1572
|
+
"if": {
|
|
1573
|
+
"properties": {
|
|
1574
|
+
"topicSetTargetVerticalTiltAngle": {
|
|
1575
|
+
"minLength": 1
|
|
1576
|
+
}
|
|
1577
|
+
},
|
|
1578
|
+
"required": ["topicSetTargetVerticalTiltAngle"]
|
|
1579
|
+
},
|
|
1580
|
+
"then": {
|
|
1581
|
+
"required": ["topicGetCurrentVerticalTiltAngle"]
|
|
1582
|
+
}
|
|
1416
1583
|
}
|
|
1417
1584
|
]
|
|
1418
1585
|
},
|
|
@@ -1817,6 +1984,150 @@
|
|
|
1817
1984
|
}
|
|
1818
1985
|
]
|
|
1819
1986
|
},
|
|
1987
|
+
{
|
|
1988
|
+
"type": "fieldset",
|
|
1989
|
+
"notitle": true,
|
|
1990
|
+
"condition": {
|
|
1991
|
+
"functionBody": "return ['WindowCovering'].includes(model.accessories?.[arguments[1]]?.info?.type);"
|
|
1992
|
+
},
|
|
1993
|
+
"items": [
|
|
1994
|
+
{
|
|
1995
|
+
"type": "fieldset",
|
|
1996
|
+
"notitle": true,
|
|
1997
|
+
"items": [
|
|
1998
|
+
{
|
|
1999
|
+
"type": "div",
|
|
2000
|
+
"displayFlex": true,
|
|
2001
|
+
"flex-direction": "row",
|
|
2002
|
+
"items": [
|
|
2003
|
+
{
|
|
2004
|
+
"key": "accessories[].topicGetCurrentPosition",
|
|
2005
|
+
"flex": "0 0 50%"
|
|
2006
|
+
},
|
|
2007
|
+
{
|
|
2008
|
+
"key": "accessories[].topicGetPositionState",
|
|
2009
|
+
"flex": "0 0 50%"
|
|
2010
|
+
}
|
|
2011
|
+
]
|
|
2012
|
+
},
|
|
2013
|
+
{
|
|
2014
|
+
"type": "div",
|
|
2015
|
+
"displayFlex": true,
|
|
2016
|
+
"flex-direction": "row",
|
|
2017
|
+
"items": [
|
|
2018
|
+
{
|
|
2019
|
+
"key": "accessories[].topicGetTargetPosition",
|
|
2020
|
+
"flex": "0 0 50%"
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
"key": "accessories[].topicSetTargetPosition",
|
|
2024
|
+
"flex": "0 0 50%"
|
|
2025
|
+
}
|
|
2026
|
+
]
|
|
2027
|
+
}
|
|
2028
|
+
]
|
|
2029
|
+
}
|
|
2030
|
+
]
|
|
2031
|
+
},
|
|
2032
|
+
{
|
|
2033
|
+
"type": "fieldset",
|
|
2034
|
+
"notitle": true,
|
|
2035
|
+
"condition": {
|
|
2036
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'WindowCovering';"
|
|
2037
|
+
},
|
|
2038
|
+
"items": [
|
|
2039
|
+
{
|
|
2040
|
+
"type": "fieldset",
|
|
2041
|
+
"notitle": true,
|
|
2042
|
+
"items": [
|
|
2043
|
+
{
|
|
2044
|
+
"type": "div",
|
|
2045
|
+
"displayFlex": true,
|
|
2046
|
+
"flex-direction": "row",
|
|
2047
|
+
"items": [
|
|
2048
|
+
{
|
|
2049
|
+
"key": "accessories[].topicGetCurrentHorizontalTiltAngle",
|
|
2050
|
+
"flex": "0 0 50%"
|
|
2051
|
+
}
|
|
2052
|
+
]
|
|
2053
|
+
},
|
|
2054
|
+
{
|
|
2055
|
+
"type": "div",
|
|
2056
|
+
"displayFlex": true,
|
|
2057
|
+
"flex-direction": "row",
|
|
2058
|
+
"items": [
|
|
2059
|
+
{
|
|
2060
|
+
"key": "accessories[].topicGetTargetHorizontalTiltAngle",
|
|
2061
|
+
"flex": "0 0 50%"
|
|
2062
|
+
},
|
|
2063
|
+
{
|
|
2064
|
+
"key": "accessories[].topicSetTargetHorizontalTiltAngle",
|
|
2065
|
+
"flex": "0 0 50%"
|
|
2066
|
+
}
|
|
2067
|
+
]
|
|
2068
|
+
},
|
|
2069
|
+
{
|
|
2070
|
+
"type": "div",
|
|
2071
|
+
"displayFlex": true,
|
|
2072
|
+
"flex-direction": "row",
|
|
2073
|
+
"items": [
|
|
2074
|
+
{
|
|
2075
|
+
"type": "div",
|
|
2076
|
+
"displayFlex": true,
|
|
2077
|
+
"flex-direction": "row",
|
|
2078
|
+
"items": [
|
|
2079
|
+
{
|
|
2080
|
+
"key": "accessories[].topicGetCurrentVerticalTiltAngle",
|
|
2081
|
+
"flex": "0 0 50%"
|
|
2082
|
+
}
|
|
2083
|
+
]
|
|
2084
|
+
}
|
|
2085
|
+
]
|
|
2086
|
+
},
|
|
2087
|
+
{
|
|
2088
|
+
"type": "div",
|
|
2089
|
+
"displayFlex": true,
|
|
2090
|
+
"flex-direction": "row",
|
|
2091
|
+
"items": [
|
|
2092
|
+
{
|
|
2093
|
+
"key": "accessories[].topicGetTargetVerticalTiltAngle",
|
|
2094
|
+
"flex": "0 0 50%"
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
"key": "accessories[].topicSetTargetVerticalTiltAngle",
|
|
2098
|
+
"flex": "0 0 50%"
|
|
2099
|
+
}
|
|
2100
|
+
]
|
|
2101
|
+
}
|
|
2102
|
+
]
|
|
2103
|
+
}
|
|
2104
|
+
]
|
|
2105
|
+
},
|
|
2106
|
+
{
|
|
2107
|
+
"type": "fieldset",
|
|
2108
|
+
"notitle": true,
|
|
2109
|
+
"condition": {
|
|
2110
|
+
"functionBody": "return ['WindowCovering'].includes(model.accessories?.[arguments[1]]?.info?.type);"
|
|
2111
|
+
},
|
|
2112
|
+
"items": [
|
|
2113
|
+
{
|
|
2114
|
+
"type": "div",
|
|
2115
|
+
"displayFlex": true,
|
|
2116
|
+
"flex-direction": "row",
|
|
2117
|
+
"items": [
|
|
2118
|
+
{
|
|
2119
|
+
"key": "accessories[].topicSetHoldPosition",
|
|
2120
|
+
"flex": "0 0 50%"
|
|
2121
|
+
},
|
|
2122
|
+
{
|
|
2123
|
+
"key": "accessories[].topicGetObstructionDetected",
|
|
2124
|
+
"title": "${config.title.topicGetObstructionDetectedOptional}",
|
|
2125
|
+
"flex": "0 0 50%"
|
|
2126
|
+
}
|
|
2127
|
+
]
|
|
2128
|
+
}
|
|
2129
|
+
]
|
|
2130
|
+
},
|
|
1820
2131
|
{
|
|
1821
2132
|
"type": "fieldset",
|
|
1822
2133
|
"notitle": true,
|
|
@@ -2923,6 +3234,53 @@
|
|
|
2923
3234
|
}
|
|
2924
3235
|
]
|
|
2925
3236
|
},
|
|
3237
|
+
{
|
|
3238
|
+
"type": "fieldset",
|
|
3239
|
+
"notitle": true,
|
|
3240
|
+
"condition": {
|
|
3241
|
+
"functionBody": "return ['WindowCovering'].includes(model.accessories?.[arguments[1]]?.info?.type);"
|
|
3242
|
+
},
|
|
3243
|
+
"items": [
|
|
3244
|
+
{
|
|
3245
|
+
"type": "div",
|
|
3246
|
+
"displayFlex": true,
|
|
3247
|
+
"flex-direction": "row",
|
|
3248
|
+
"items": [
|
|
3249
|
+
{
|
|
3250
|
+
"key": "accessories[].valuePositionDecreasing",
|
|
3251
|
+
"flex": "0 0 25%"
|
|
3252
|
+
},
|
|
3253
|
+
{
|
|
3254
|
+
"key": "accessories[].valuePositionIncreasing",
|
|
3255
|
+
"flex": "0 0 25%"
|
|
3256
|
+
},
|
|
3257
|
+
{
|
|
3258
|
+
"key": "accessories[].valuePositionStopped",
|
|
3259
|
+
"flex": "0 0 25%"
|
|
3260
|
+
}
|
|
3261
|
+
]
|
|
3262
|
+
},
|
|
3263
|
+
{
|
|
3264
|
+
"type": "div",
|
|
3265
|
+
"displayFlex": true,
|
|
3266
|
+
"flex-direction": "row",
|
|
3267
|
+
"items": [
|
|
3268
|
+
{
|
|
3269
|
+
"key": "accessories[].valuePositionHold",
|
|
3270
|
+
"flex": "0 0 25%"
|
|
3271
|
+
},
|
|
3272
|
+
{
|
|
3273
|
+
"key": "accessories[].valuePositionResume",
|
|
3274
|
+
"flex": "0 0 25%"
|
|
3275
|
+
},
|
|
3276
|
+
{
|
|
3277
|
+
"key": "accessories[].valuePositionObstructed",
|
|
3278
|
+
"flex": "0 0 25%"
|
|
3279
|
+
}
|
|
3280
|
+
]
|
|
3281
|
+
}
|
|
3282
|
+
]
|
|
3283
|
+
},
|
|
2926
3284
|
{
|
|
2927
3285
|
"type": "fieldset",
|
|
2928
3286
|
"notitle": true,
|
|
@@ -10,6 +10,7 @@ import { ThermostatAccessory } from '../climate/thermostat.js';
|
|
|
10
10
|
import { LightbulbAccessory } from '../onoff/lightbulb.js';
|
|
11
11
|
import { OutletAccessory } from '../onoff/outlet.js';
|
|
12
12
|
import { SwitchAccessory } from '../onoff/switch.js';
|
|
13
|
+
import { BlindAccessory } from '../position/blind.js';
|
|
13
14
|
import { AirSensorAccessory } from '../sensor/air.js';
|
|
14
15
|
import { CO2SensorAccessory } from '../sensor/carbonDioxide.js';
|
|
15
16
|
import { COSensorAccessory } from '../sensor/carbonMonoxide.js';
|
|
@@ -32,6 +33,8 @@ export function createAccessory(Service, Characteristic, platformAccessory, acce
|
|
|
32
33
|
return new PurifierAccessory(Service, Characteristic, platformAccessory, accessoryConfig, log, isGrouped);
|
|
33
34
|
case AccessoryType.AirQualitySensor:
|
|
34
35
|
return new AirSensorAccessory(Service, Characteristic, platformAccessory, accessoryConfig, log, isGrouped);
|
|
36
|
+
case AccessoryType.WindowCovering:
|
|
37
|
+
return new BlindAccessory(Service, Characteristic, platformAccessory, accessoryConfig, log, isGrouped);
|
|
35
38
|
case AccessoryType.CarbonDioxideSensor:
|
|
36
39
|
return new CO2SensorAccessory(Service, Characteristic, platformAccessory, accessoryConfig, log, isGrouped);
|
|
37
40
|
case AccessoryType.CarbonMonoxideSensor:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/accessory/abstract/helper.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AA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AE,iBAAiB,EAAE,eAA2C,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QAC1I,KAAK,aAAa,CAAC,KAAK;YACtB,OAAO,IAAI,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAsC,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAChI,CAAC;IAED,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PlatformAccessory } from 'homebridge';
|
|
2
|
+
import { PositionAccessory } from './position.js';
|
|
3
|
+
import { AccessoryType } from '../../model/enums.js';
|
|
4
|
+
import { CharacteristicType, BlindConfig, ServiceType } from '../../model/types.js';
|
|
5
|
+
import { Log } from '../../tools/log.js';
|
|
6
|
+
export declare class BlindAccessory extends PositionAccessory<BlindConfig> {
|
|
7
|
+
constructor(Service: ServiceType, Characteristic: CharacteristicType, accessory: PlatformAccessory, config: BlindConfig, log: Log, isGrouped: boolean);
|
|
8
|
+
protected getAccessoryType(): AccessoryType;
|
|
9
|
+
private onSetTilt;
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PositionAccessory } from './position.js';
|
|
2
|
+
import { strings } from '../../i18n/i18n.js';
|
|
3
|
+
import { AccessoryType, CharacteristicKey } from '../../model/enums.js';
|
|
4
|
+
export class BlindAccessory extends PositionAccessory {
|
|
5
|
+
constructor(Service, Characteristic, accessory, config, log, isGrouped) {
|
|
6
|
+
super(Service, Characteristic, accessory, config, log, isGrouped);
|
|
7
|
+
this.setupCharacteristic(CharacteristicKey.CurrentHorizontalTiltAngle, 0, 'topicGetCurrentHorizontalTiltAngle', this.bindOnUpdateNumeric(CharacteristicKey.CurrentHorizontalTiltAngle, strings.position.blind.currentHorizontal), false);
|
|
8
|
+
this.setupCharacteristic(CharacteristicKey.CurrentVerticalTiltAngle, 0, 'topicGetCurrentVerticalTiltAngle', this.bindOnUpdateNumeric(CharacteristicKey.CurrentVerticalTiltAngle, strings.position.blind.currentVertical), false);
|
|
9
|
+
this.setupCharacteristic(CharacteristicKey.TargetHorizontalTiltAngle, 0, 'topicGetTargetHorizontalTiltAngle', this.bindOnUpdateNumeric(CharacteristicKey.TargetHorizontalTiltAngle, strings.position.blind.targetHorizontal), false, 'topicSetTargetHorizontalTiltAngle', this.onSetTilt(CharacteristicKey.TargetHorizontalTiltAngle, 'topicSetTargetHorizontalTiltAngle', strings.position.blind.targetHorizontalSet));
|
|
10
|
+
this.setupCharacteristic(CharacteristicKey.TargetVerticalTiltAngle, 0, 'topicGetTargetVerticalTiltAngle', this.bindOnUpdateNumeric(CharacteristicKey.TargetVerticalTiltAngle, strings.position.blind.targetVertical), false, 'topicSetTargetVerticalTiltAngle', this.onSetTilt(CharacteristicKey.TargetVerticalTiltAngle, 'topicSetTargetVerticalTiltAngle', strings.position.blind.targetVerticalSet));
|
|
11
|
+
}
|
|
12
|
+
getAccessoryType() {
|
|
13
|
+
return AccessoryType.WindowCovering;
|
|
14
|
+
}
|
|
15
|
+
onSetTilt(key, topic, logTemplate) {
|
|
16
|
+
return (async (value) => {
|
|
17
|
+
const logString = logTemplate.replace('%d', value.toString());
|
|
18
|
+
this.onSet(key, value, value, topic, logString);
|
|
19
|
+
}).bind(this);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=blind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blind.js","sourceRoot":"","sources":["../../../src/accessory/position/blind.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAKxE,MAAM,OAAO,cAAe,SAAQ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AS,CAAC,iBAAiB,CAAC,uBAAuB,EAAE,iCAAiC,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC5I,CAAC;IAES,gBAAgB;QACxB,OAAO,aAAa,CAAC,cAAc,CAAC;IACtC,CAAC;IAEO,SAAS,CAAC,GAAsB,EAAE,KAAwB,EAAE,WAAmB;QACrF,OAAO,CAAC,KAAK,EAAE,KAA0B,EAAE,EAAE;YAC3C,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC9D,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,KAAe,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PlatformAccessory } from 'homebridge';
|
|
2
|
+
import { BaseAccessory } from '../abstract/base.js';
|
|
3
|
+
import { CharacteristicType, PositionConfig, ServiceType } from '../../model/types.js';
|
|
4
|
+
import { Log } from '../../tools/log.js';
|
|
5
|
+
export declare abstract class PositionAccessory<C extends PositionConfig = PositionConfig> extends BaseAccessory<C> {
|
|
6
|
+
private readonly STATE_MAP;
|
|
7
|
+
constructor(Service: ServiceType, Characteristic: CharacteristicType, accessory: PlatformAccessory, config: C, log: Log, isGrouped: boolean);
|
|
8
|
+
private onSetTargetPosition;
|
|
9
|
+
private onSetHoldPosition;
|
|
10
|
+
private onPositionStateUpdate;
|
|
11
|
+
private onObstructionUpdate;
|
|
12
|
+
private toCVState;
|
|
13
|
+
private stateStringForCV;
|
|
14
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { BaseAccessory } from '../abstract/base.js';
|
|
2
|
+
import { strings } from '../../i18n/i18n.js';
|
|
3
|
+
import { CharacteristicKey } from '../../model/enums.js';
|
|
4
|
+
import { LogType } from '../../tools/log.js';
|
|
5
|
+
export class PositionAccessory extends BaseAccessory {
|
|
6
|
+
STATE_MAP;
|
|
7
|
+
constructor(Service, Characteristic, accessory, config, log, isGrouped) {
|
|
8
|
+
super(Service, Characteristic, accessory, config, log, isGrouped);
|
|
9
|
+
this.setupCharacteristic(CharacteristicKey.CurrentPosition, 0, 'topicGetCurrentPosition', this.bindOnUpdateNumeric(CharacteristicKey.CurrentPosition, strings.position.current), true);
|
|
10
|
+
this.setupCharacteristic(CharacteristicKey.TargetPosition, 0, 'topicGetTargetPosition', this.bindOnUpdateNumeric(CharacteristicKey.TargetPosition, strings.position.target), true, 'topicSetTargetPosition', this.onSetTargetPosition.bind(this));
|
|
11
|
+
this.STATE_MAP = new Map([
|
|
12
|
+
['valuePositionDecreasing', Characteristic.PositionState.DECREASING],
|
|
13
|
+
['valuePositionIncreasing', Characteristic.PositionState.INCREASING],
|
|
14
|
+
['valuePositionStopped', Characteristic.PositionState.STOPPED],
|
|
15
|
+
]);
|
|
16
|
+
const validStates = Array.from(this.STATE_MAP.keys()).filter((key) => this.getRawValue(key, false) !== undefined);
|
|
17
|
+
if (validStates.length === 0) {
|
|
18
|
+
this.log.error(strings.position.noPositionValues, this.name);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this.setupCharacteristic(CharacteristicKey.PositionState, Characteristic.PositionState.STOPPED, 'topicGetPositionState', this.onPositionStateUpdate.bind(this), true)?.setProps({ validValues: validStates.map((key) => this.STATE_MAP.get(key)) });
|
|
22
|
+
this.setupCharacteristicOnSet(CharacteristicKey.HoldPosition, 'topicSetHoldPosition', this.onSetHoldPosition.bind(this));
|
|
23
|
+
this.setupCharacteristic(CharacteristicKey.ObstructionDetected, false, 'topicGetObstructionDetected', this.onObstructionUpdate.bind(this), false);
|
|
24
|
+
}
|
|
25
|
+
async onSetTargetPosition(value) {
|
|
26
|
+
const logString = strings.position.targetSet.replace('%d', value.toString());
|
|
27
|
+
this.onSet(CharacteristicKey.TargetPosition, value, value, 'topicSetTargetPosition', logString);
|
|
28
|
+
}
|
|
29
|
+
async onSetHoldPosition(value) {
|
|
30
|
+
if (!this.assert('valuePositionHold', 'valuePositionResume')) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const publish = value ? this.config.valuePositionHold : this.config.valuePositionResume;
|
|
34
|
+
const logString = value ? strings.position.hold : strings.position.resume;
|
|
35
|
+
this.onSet(CharacteristicKey.HoldPosition, value, publish, 'topicSetHoldPosition', logString);
|
|
36
|
+
}
|
|
37
|
+
async onPositionStateUpdate(topic, value) {
|
|
38
|
+
const current = this.toCVState(value);
|
|
39
|
+
if (current === undefined) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.onUpdate(CharacteristicKey.PositionState, current, this.stateStringForCV(current));
|
|
43
|
+
}
|
|
44
|
+
async onObstructionUpdate(topic, value) {
|
|
45
|
+
const obstructed = value === this.getPrimitiveValue('valuePositionObstructed');
|
|
46
|
+
if (!this.onUpdate(CharacteristicKey.ObstructionDetected, obstructed)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (obstructed) {
|
|
50
|
+
this.logIfDesired(LogType.ERROR, strings.position.obstructed);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.logIfDesired(strings.position.unobstructed);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
toCVState(value) {
|
|
57
|
+
switch (value) {
|
|
58
|
+
case this.getPrimitiveValue('valuePositionDecreasing', false):
|
|
59
|
+
return this.STATE_MAP.get('valuePositionDecreasing');
|
|
60
|
+
case this.getPrimitiveValue('valuePositionIncreasing', false):
|
|
61
|
+
return this.STATE_MAP.get('valuePositionIncreasing');
|
|
62
|
+
case this.getPrimitiveValue('valuePositionStopped', false):
|
|
63
|
+
return this.STATE_MAP.get('valuePositionStopped');
|
|
64
|
+
}
|
|
65
|
+
this.logIfDesired(strings.position.unknownValue, `'${value}'`);
|
|
66
|
+
}
|
|
67
|
+
stateStringForCV(state) {
|
|
68
|
+
switch (state) {
|
|
69
|
+
case this.Characteristic.PositionState.DECREASING:
|
|
70
|
+
return strings.position.stateDecreasing;
|
|
71
|
+
case this.Characteristic.PositionState.INCREASING:
|
|
72
|
+
return strings.position.stateIncreasing;
|
|
73
|
+
case this.Characteristic.PositionState.STOPPED:
|
|
74
|
+
return strings.position.stateStopped;
|
|
75
|
+
default:
|
|
76
|
+
return strings.position.stateUnknown;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=position.js.map
|