@marcel2215/homebridge-supla-plugin 2.1.23 → 2.1.25
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/.codex/environments/environment.toml +31 -0
- package/config.schema.json +53 -3
- package/dist/Accesories/FrontGateFsm.d.ts +123 -0
- package/dist/Accesories/FrontGateFsm.d.ts.map +1 -0
- package/dist/Accesories/FrontGateFsm.js +496 -0
- package/dist/Accesories/FrontGateFsm.js.map +1 -0
- package/dist/Accesories/GateAccessory.d.ts +15 -54
- package/dist/Accesories/GateAccessory.d.ts.map +1 -1
- package/dist/Accesories/GateAccessory.js +247 -424
- package/dist/Accesories/GateAccessory.js.map +1 -1
- package/dist/platform.d.ts +26 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +126 -5
- package/dist/platform.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# THIS IS AUTOGENERATED. DO NOT EDIT MANUALLY
|
|
2
|
+
version = 1
|
|
3
|
+
name = "homebridge-supla-plugin"
|
|
4
|
+
|
|
5
|
+
[setup]
|
|
6
|
+
script = ""
|
|
7
|
+
|
|
8
|
+
[[actions]]
|
|
9
|
+
name = "Bump Major"
|
|
10
|
+
icon = "tool"
|
|
11
|
+
command = "npm run version:bump:major"
|
|
12
|
+
|
|
13
|
+
[[actions]]
|
|
14
|
+
name = "Bump Minor"
|
|
15
|
+
icon = "tool"
|
|
16
|
+
command = "npm run version:bump:minor"
|
|
17
|
+
|
|
18
|
+
[[actions]]
|
|
19
|
+
name = "Bump Revision"
|
|
20
|
+
icon = "tool"
|
|
21
|
+
command = "npm run version:bump:revision"
|
|
22
|
+
|
|
23
|
+
[[actions]]
|
|
24
|
+
name = "Publish"
|
|
25
|
+
icon = "tool"
|
|
26
|
+
command = "npm run publish:plugin"
|
|
27
|
+
|
|
28
|
+
[[actions]]
|
|
29
|
+
name = "Login"
|
|
30
|
+
icon = "tool"
|
|
31
|
+
command = "npm login"
|
package/config.schema.json
CHANGED
|
@@ -70,17 +70,17 @@
|
|
|
70
70
|
"gateExecuteActionOpen": {
|
|
71
71
|
"title": "Gate Execute Action Open",
|
|
72
72
|
"type": "string",
|
|
73
|
-
"default": "
|
|
73
|
+
"default": "open_close"
|
|
74
74
|
},
|
|
75
75
|
"gateExecuteActionClose": {
|
|
76
76
|
"title": "Gate Execute Action Close",
|
|
77
77
|
"type": "string",
|
|
78
|
-
"default": "
|
|
78
|
+
"default": "open_close"
|
|
79
79
|
},
|
|
80
80
|
"gateExecuteActionToggle": {
|
|
81
81
|
"title": "Gate Execute Action Toggle",
|
|
82
82
|
"type": "string",
|
|
83
|
-
"default": "
|
|
83
|
+
"default": "open_close"
|
|
84
84
|
},
|
|
85
85
|
"gatePartialHiMode": {
|
|
86
86
|
"title": "Gate Partial Hi Mode",
|
|
@@ -98,6 +98,56 @@
|
|
|
98
98
|
"type": "number",
|
|
99
99
|
"default": 3000
|
|
100
100
|
},
|
|
101
|
+
"gateOpenAssumeDelayMs": {
|
|
102
|
+
"title": "Gate Open Assume Delay (ms)",
|
|
103
|
+
"type": "number",
|
|
104
|
+
"default": 22000
|
|
105
|
+
},
|
|
106
|
+
"gateCommandCooldownMs": {
|
|
107
|
+
"title": "Gate Command Cooldown (ms)",
|
|
108
|
+
"type": "number",
|
|
109
|
+
"default": 700
|
|
110
|
+
},
|
|
111
|
+
"gatePublishRetryDelayMs": {
|
|
112
|
+
"title": "Gate Publish Retry Delay (ms)",
|
|
113
|
+
"type": "number",
|
|
114
|
+
"default": 300
|
|
115
|
+
},
|
|
116
|
+
"gateStrictReverseDoublePulse": {
|
|
117
|
+
"title": "Gate Strict Reverse Double Pulse",
|
|
118
|
+
"type": "boolean",
|
|
119
|
+
"default": true
|
|
120
|
+
},
|
|
121
|
+
"gateDebugTimeline": {
|
|
122
|
+
"title": "Gate Debug Timeline",
|
|
123
|
+
"type": "boolean",
|
|
124
|
+
"default": false
|
|
125
|
+
},
|
|
126
|
+
"frontGateFullTravelMs": {
|
|
127
|
+
"title": "Front Gate Full Travel (ms)",
|
|
128
|
+
"type": "number",
|
|
129
|
+
"default": 25000
|
|
130
|
+
},
|
|
131
|
+
"frontGateReversePauseMs": {
|
|
132
|
+
"title": "Front Gate Reverse Pause (ms)",
|
|
133
|
+
"type": "number",
|
|
134
|
+
"default": 900
|
|
135
|
+
},
|
|
136
|
+
"frontGateWrongDirectionRunMs": {
|
|
137
|
+
"title": "Front Gate Wrong Direction Run (ms)",
|
|
138
|
+
"type": "number",
|
|
139
|
+
"default": 700
|
|
140
|
+
},
|
|
141
|
+
"frontGateMinimumPulseGapMs": {
|
|
142
|
+
"title": "Front Gate Minimum Pulse Gap (ms)",
|
|
143
|
+
"type": "number",
|
|
144
|
+
"default": 400
|
|
145
|
+
},
|
|
146
|
+
"frontGateCloseRetryLimit": {
|
|
147
|
+
"title": "Front Gate Close Retry Limit",
|
|
148
|
+
"type": "number",
|
|
149
|
+
"default": 1
|
|
150
|
+
},
|
|
101
151
|
"gateLockControlMode": {
|
|
102
152
|
"title": "Gate Lock Control Mode",
|
|
103
153
|
"type": "string",
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export type GateTarget = 'open' | 'closed';
|
|
2
|
+
export type MotionDirection = 'opening' | 'closing';
|
|
3
|
+
export type MotionCertainty = 'known' | 'goalOnly';
|
|
4
|
+
export type MotionSource = 'homekit' | 'external' | 'recovery';
|
|
5
|
+
export declare const enum DoorCurrentState {
|
|
6
|
+
OPEN = 0,
|
|
7
|
+
CLOSED = 1,
|
|
8
|
+
OPENING = 2,
|
|
9
|
+
CLOSING = 3,
|
|
10
|
+
STOPPED = 4
|
|
11
|
+
}
|
|
12
|
+
export declare const enum DoorTargetState {
|
|
13
|
+
OPEN = 0,
|
|
14
|
+
CLOSED = 1
|
|
15
|
+
}
|
|
16
|
+
export interface FrontGateTimingConfig {
|
|
17
|
+
fullTravelMs: number;
|
|
18
|
+
reversePauseMs: number;
|
|
19
|
+
wrongDirectionRunMs: number;
|
|
20
|
+
minimumPulseGapMs: number;
|
|
21
|
+
closeRetryLimit: number;
|
|
22
|
+
}
|
|
23
|
+
export declare const DEFAULT_FRONT_GATE_TIMINGS: FrontGateTimingConfig;
|
|
24
|
+
export interface PersistedFrontGateState {
|
|
25
|
+
}
|
|
26
|
+
export interface FrontGateSnapshot {
|
|
27
|
+
available: boolean;
|
|
28
|
+
controlConnected: boolean | null;
|
|
29
|
+
sensorConnected: boolean | null;
|
|
30
|
+
closedSensor: boolean | null;
|
|
31
|
+
sensorFreshSinceOnline: boolean;
|
|
32
|
+
currentDoorState?: DoorCurrentState;
|
|
33
|
+
targetDoorState?: DoorTargetState;
|
|
34
|
+
requestedTarget: GateTarget | null;
|
|
35
|
+
motionDirection: MotionDirection | 'none';
|
|
36
|
+
motionCertainty: MotionCertainty | 'none';
|
|
37
|
+
planKind: Plan['kind'];
|
|
38
|
+
note: string;
|
|
39
|
+
}
|
|
40
|
+
export interface FrontGateLogger {
|
|
41
|
+
debug(message: string): void;
|
|
42
|
+
info(message: string): void;
|
|
43
|
+
warn(message: string): void;
|
|
44
|
+
}
|
|
45
|
+
export interface FrontGateIo {
|
|
46
|
+
pulseMotor(reason: string): Promise<void>;
|
|
47
|
+
publishSnapshot(snapshot: FrontGateSnapshot): void;
|
|
48
|
+
log: FrontGateLogger;
|
|
49
|
+
}
|
|
50
|
+
type Plan = {
|
|
51
|
+
kind: 'idle';
|
|
52
|
+
} | {
|
|
53
|
+
kind: 'moving';
|
|
54
|
+
direction: MotionDirection;
|
|
55
|
+
certainty: MotionCertainty;
|
|
56
|
+
source: MotionSource;
|
|
57
|
+
attempt: number;
|
|
58
|
+
startedAt: number;
|
|
59
|
+
deadlineAt: number;
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'waitingSecondPulse';
|
|
62
|
+
finalDirection: MotionDirection;
|
|
63
|
+
source: MotionSource;
|
|
64
|
+
attempt: number;
|
|
65
|
+
dueAt: number;
|
|
66
|
+
deadlineAt: number;
|
|
67
|
+
reason: 'reverseToOpen' | 'reverseToClose';
|
|
68
|
+
};
|
|
69
|
+
export declare class FrontGateFsm {
|
|
70
|
+
private readonly io;
|
|
71
|
+
private readonly travelMs;
|
|
72
|
+
private readonly pulseGapMs;
|
|
73
|
+
private readonly closeRetryLimit;
|
|
74
|
+
private facts;
|
|
75
|
+
private sensorFreshSinceOnline;
|
|
76
|
+
private requestedTarget;
|
|
77
|
+
private plan;
|
|
78
|
+
private lastPulseLikeActivityAt;
|
|
79
|
+
private movementTimer?;
|
|
80
|
+
private movementTimerToken;
|
|
81
|
+
private phaseTimer?;
|
|
82
|
+
private phaseTimerToken;
|
|
83
|
+
private sequence;
|
|
84
|
+
private disposed;
|
|
85
|
+
constructor(io: FrontGateIo, timings?: FrontGateTimingConfig, _persisted?: PersistedFrontGateState);
|
|
86
|
+
dispose(): void;
|
|
87
|
+
handleConnectedChange(connected: boolean): void;
|
|
88
|
+
handleControlConnectedChange(connected: boolean): void;
|
|
89
|
+
handleSensorConnectedChange(connected: boolean): void;
|
|
90
|
+
handleClosedSensorChange(closed: boolean): void;
|
|
91
|
+
requestHomeKitTarget(target: GateTarget): Promise<void>;
|
|
92
|
+
getSnapshot(): FrontGateSnapshot;
|
|
93
|
+
private enqueue;
|
|
94
|
+
private applyControlConnectedChange;
|
|
95
|
+
private applySensorConnectedChange;
|
|
96
|
+
private applyClosedSensorChange;
|
|
97
|
+
private applyHomeKitTarget;
|
|
98
|
+
private handleOpenRequest;
|
|
99
|
+
private handleCloseRequest;
|
|
100
|
+
private startOpeningFromClosed;
|
|
101
|
+
private startCloseSeek;
|
|
102
|
+
private reverseKnownMotion;
|
|
103
|
+
private startOpeningMotion;
|
|
104
|
+
private startClosingMotion;
|
|
105
|
+
private scheduleMovementTimer;
|
|
106
|
+
private schedulePhaseTimer;
|
|
107
|
+
private clearMovementTimer;
|
|
108
|
+
private clearPhaseTimer;
|
|
109
|
+
private clearTimers;
|
|
110
|
+
private handlePhaseTimer;
|
|
111
|
+
private handleMovementTimeout;
|
|
112
|
+
private enterUnavailable;
|
|
113
|
+
private isAvailableForHomeKit;
|
|
114
|
+
private pulseMotor;
|
|
115
|
+
private emitSnapshot;
|
|
116
|
+
private buildSnapshot;
|
|
117
|
+
private getMotionDirection;
|
|
118
|
+
private getMotionCertainty;
|
|
119
|
+
private computeCurrentDoorState;
|
|
120
|
+
private computeTargetDoorState;
|
|
121
|
+
}
|
|
122
|
+
export {};
|
|
123
|
+
//# sourceMappingURL=FrontGateFsm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrontGateFsm.d.ts","sourceRoot":"","sources":["../../src/Accesories/FrontGateFsm.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AAC3C,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,CAAC;AACpD,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,UAAU,CAAC;AACnD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE/D,0BAAkB,gBAAgB;IAChC,IAAI,IAAI;IACR,MAAM,IAAI;IACV,OAAO,IAAI;IACX,OAAO,IAAI;IACX,OAAO,IAAI;CACZ;AAED,0BAAkB,eAAe;IAC/B,IAAI,IAAI;IACR,MAAM,IAAI;CACX;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,0BAA0B,EAAE,qBAMxC,CAAC;AAEF,MAAM,WAAW,uBAAuB;CAIvC;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,e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