homebridge-ratgdo 2.9.3 → 2.10.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/README.md +0 -11
- package/dist/ratgdo-device.js +5 -1
- package/dist/ratgdo-device.js.map +1 -1
- package/dist/ratgdo-options.js +10 -8
- package/dist/ratgdo-options.js.map +1 -1
- package/dist/ratgdo-platform.d.ts +1 -1
- package/dist/ratgdo-platform.js +25 -8
- package/dist/ratgdo-platform.js.map +1 -1
- package/dist/settings.js.map +1 -1
- package/homebridge-ui/public/index.html +51 -49
- package/homebridge-ui/public/lib/featureoptions.js.map +1 -1
- package/homebridge-ui/public/lib/webUi-featureoptions.mjs +3300 -551
- package/homebridge-ui/public/lib/webUi.mjs +13 -5
- package/homebridge-ui/public/ui.mjs +18 -6
- package/package.json +10 -9
- package/dist/ratgdo-api.d.ts +0 -348
- package/dist/ratgdo-api.js +0 -1232
- package/dist/ratgdo-api.js.map +0 -1
|
@@ -57,7 +57,7 @@ export class webUi {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
// Show the first run user experience if
|
|
60
|
+
// Show the first run user experience if needed.
|
|
61
61
|
async #showFirstRun() {
|
|
62
62
|
|
|
63
63
|
const buttonFirstRun = document.getElementById("firstRun");
|
|
@@ -68,6 +68,9 @@ export class webUi {
|
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
// We disable saving any settings until we configure the plugin.
|
|
72
|
+
homebridge.disableSaveButton();
|
|
73
|
+
|
|
71
74
|
// First run user experience.
|
|
72
75
|
buttonFirstRun.addEventListener("click", async () => {
|
|
73
76
|
|
|
@@ -80,10 +83,13 @@ export class webUi {
|
|
|
80
83
|
return;
|
|
81
84
|
}
|
|
82
85
|
|
|
83
|
-
// Create our UI.
|
|
86
|
+
// Create our UI and allow users to save the configuration.
|
|
84
87
|
document.getElementById("pageFirstRun").style.display = "none";
|
|
85
88
|
document.getElementById("menuWrapper").style.display = "inline-flex";
|
|
86
|
-
|
|
89
|
+
|
|
90
|
+
await this.featureOptions.show();
|
|
91
|
+
|
|
92
|
+
homebridge.enableSaveButton();
|
|
87
93
|
|
|
88
94
|
// All done. Let the user interact with us, although in practice, we shouldn't get here.
|
|
89
95
|
// homebridge.hideSpinner();
|
|
@@ -97,6 +103,7 @@ export class webUi {
|
|
|
97
103
|
|
|
98
104
|
// Show the beachball while we setup.
|
|
99
105
|
homebridge.showSpinner();
|
|
106
|
+
this.featureOptions.hide();
|
|
100
107
|
|
|
101
108
|
// Highlight the tab in our UI.
|
|
102
109
|
this.#toggleClasses("menuHome", "btn-elegant", "btn-primary");
|
|
@@ -118,6 +125,7 @@ export class webUi {
|
|
|
118
125
|
// Show the beachball while we setup.
|
|
119
126
|
homebridge.showSpinner();
|
|
120
127
|
homebridge.hideSchemaForm();
|
|
128
|
+
this.featureOptions.hide();
|
|
121
129
|
|
|
122
130
|
// Highlight the tab in our UI.
|
|
123
131
|
this.#toggleClasses("menuHome", "btn-primary", "btn-elegant");
|
|
@@ -139,14 +147,14 @@ export class webUi {
|
|
|
139
147
|
|
|
140
148
|
// Add our event listeners to animate the UI.
|
|
141
149
|
document.getElementById("menuHome").addEventListener("click", () => this.#showSupport());
|
|
142
|
-
document.getElementById("menuFeatureOptions").addEventListener("click", () => this.featureOptions.show());
|
|
150
|
+
document.getElementById("menuFeatureOptions").addEventListener("click", async () => await this.featureOptions.show());
|
|
143
151
|
document.getElementById("menuSettings").addEventListener("click", () => this.#showSettings());
|
|
144
152
|
|
|
145
153
|
// If we've got devices detected, we launch our feature option UI. Otherwise, we launch our first run UI.
|
|
146
154
|
if(this.featureOptions.currentConfig.length && !(await this.#processHandler(this.#firstRun.isRequired))) {
|
|
147
155
|
|
|
148
156
|
document.getElementById("menuWrapper").style.display = "inline-flex";
|
|
149
|
-
this.featureOptions.show();
|
|
157
|
+
await this.featureOptions.show();
|
|
150
158
|
|
|
151
159
|
return;
|
|
152
160
|
}
|
|
@@ -10,20 +10,32 @@ import { webUi } from "./lib/webUi.mjs";
|
|
|
10
10
|
// Show the details for this device.
|
|
11
11
|
const showRatgdoDetails = (device) => {
|
|
12
12
|
|
|
13
|
+
const deviceStatsContainer = document.getElementById("deviceStatsContainer");
|
|
14
|
+
|
|
13
15
|
// No device specified, we must be in a global context.
|
|
14
16
|
if(!device) {
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
document.getElementById("device_mac").innerHTML = "N/A";
|
|
18
|
-
document.getElementById("device_firmware").innerHTML = "N/A";
|
|
18
|
+
deviceStatsContainer.textContent = "";
|
|
19
19
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// Populate the device details.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
deviceStatsContainer.innerHTML =
|
|
25
|
+
"<div class=\"device-stats-grid\">" +
|
|
26
|
+
"<div class=\"stat-item\">" +
|
|
27
|
+
"<span class=\"stat-label\">Model</span>" +
|
|
28
|
+
"<span class=\"stat-value\">" + device.model + "</span>" +
|
|
29
|
+
"</div>" +
|
|
30
|
+
"<div class=\"stat-item\">" +
|
|
31
|
+
"<span class=\"stat-label\">MAC Address</span>" +
|
|
32
|
+
"<span class=\"stat-value font-monospace\">" + device.serialNumber + "</span>" +
|
|
33
|
+
"</div>" +
|
|
34
|
+
"<div class=\"stat-item\">" +
|
|
35
|
+
"<span class=\"stat-label\">Firmware</span>" +
|
|
36
|
+
"<span class=\"stat-value\">" + device.firmwareRevision + "</span>" +
|
|
37
|
+
"</div>" +
|
|
38
|
+
"</div>";
|
|
27
39
|
};
|
|
28
40
|
|
|
29
41
|
// Parameters for our feature options webUI.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-ratgdo",
|
|
3
|
-
"displayName": "
|
|
4
|
-
"version": "2.
|
|
3
|
+
"displayName": "Ratgdo",
|
|
4
|
+
"version": "2.10.0",
|
|
5
5
|
"description": "HomeKit integration using Ratgdo and Konnected devices for LiftMaster and Chamberlain garage door openers, without requiring myQ.",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"repository": {
|
|
@@ -41,18 +41,19 @@
|
|
|
41
41
|
"ratgdo"
|
|
42
42
|
],
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@stylistic/eslint-plugin": "5.
|
|
45
|
-
"@types/node": "24.
|
|
46
|
-
"eslint": "9.
|
|
44
|
+
"@stylistic/eslint-plugin": "5.2.3",
|
|
45
|
+
"@types/node": "24.2.1",
|
|
46
|
+
"eslint": "9.33.0",
|
|
47
47
|
"homebridge": "1.11.0",
|
|
48
48
|
"shx": "0.4.0",
|
|
49
|
-
"typescript": "5.
|
|
50
|
-
"typescript-eslint": "8.
|
|
49
|
+
"typescript": "5.9.2",
|
|
50
|
+
"typescript-eslint": "8.39.1"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@homebridge/plugin-ui-utils": "2.1.0",
|
|
54
54
|
"bonjour-service": "1.3.0",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
55
|
+
"esphome-client": "1.0.0",
|
|
56
|
+
"homebridge-plugin-utils": "1.27.2",
|
|
57
|
+
"undici": "7.13.0"
|
|
57
58
|
}
|
|
58
59
|
}
|
package/dist/ratgdo-api.d.ts
DELETED
|
@@ -1,348 +0,0 @@
|
|
|
1
|
-
import type { HomebridgePluginLogging, Nullable } from "homebridge-plugin-utils";
|
|
2
|
-
import { EventEmitter } from "node:events";
|
|
3
|
-
/**
|
|
4
|
-
* Represents one entity from the ESPHome device.
|
|
5
|
-
*
|
|
6
|
-
* @property key - The numeric key identifier for the entity.
|
|
7
|
-
* @property name - The human-readable name of the entity.
|
|
8
|
-
* @property type - The type of entity (e.g., "switch", "light", "cover").
|
|
9
|
-
*/
|
|
10
|
-
interface Entity {
|
|
11
|
-
key: number;
|
|
12
|
-
name: string;
|
|
13
|
-
type: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Device information to send when requested by the ESPHome device.
|
|
17
|
-
*
|
|
18
|
-
* @property bluetoothProxyFeatureFlags - Bluetooth proxy feature flags.
|
|
19
|
-
* @property compilationTime - When the client was compiled/started.
|
|
20
|
-
* @property esphomeVersion - Version of ESPHome protocol being used.
|
|
21
|
-
* @property hasDeepSleep - Whether the client supports deep sleep.
|
|
22
|
-
* @property legacyBluetoothProxyVersion - Legacy Bluetooth proxy version.
|
|
23
|
-
* @property macAddress - MAC address of the client (format: "AA:BB:CC:DD:EE:FF").
|
|
24
|
-
* @property model - Model or type of the client.
|
|
25
|
-
* @property name - Friendly name of the client.
|
|
26
|
-
* @property projectName - Name of the project/plugin.
|
|
27
|
-
* @property projectVersion - Version of the project/plugin.
|
|
28
|
-
* @property usesPassword - Whether the client uses password authentication.
|
|
29
|
-
* @property webserverPort - Port number of any web server.
|
|
30
|
-
*/
|
|
31
|
-
export interface DeviceInfo {
|
|
32
|
-
bluetoothProxyFeatureFlags?: number;
|
|
33
|
-
compilationTime?: string;
|
|
34
|
-
esphomeVersion?: string;
|
|
35
|
-
hasDeepSleep?: boolean;
|
|
36
|
-
legacyBluetoothProxyVersion?: number;
|
|
37
|
-
macAddress?: string;
|
|
38
|
-
model?: string;
|
|
39
|
-
name?: string;
|
|
40
|
-
projectName?: string;
|
|
41
|
-
projectVersion?: string;
|
|
42
|
-
usesPassword?: boolean;
|
|
43
|
-
webserverPort?: number;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* ESPHome API client for communicating with ESPHome devices.
|
|
47
|
-
* Implements the ESPHome native API protocol over TCP.
|
|
48
|
-
*
|
|
49
|
-
* @extends EventEmitter
|
|
50
|
-
* @emits connect - Connected to device.
|
|
51
|
-
* @emits disconnect - Disconnected from device.
|
|
52
|
-
* @emits message - Raw message received with type and payload.
|
|
53
|
-
* @emits entities - List of discovered entities after enumeration.
|
|
54
|
-
* @emits telemetry - Generic telemetry update for any entity.
|
|
55
|
-
* @emits heartbeat - Heartbeat response received.
|
|
56
|
-
* @emits {entityType} - Type-specific telemetry events (e.g., "cover", "light", "switch").
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```typescript
|
|
60
|
-
* const client = new EspHomeClient(ratgdo, "192.168.1.100");
|
|
61
|
-
* client.connect();
|
|
62
|
-
*
|
|
63
|
-
* // Listen for discovered entities
|
|
64
|
-
* client.on("entities", (entities) => {
|
|
65
|
-
*
|
|
66
|
-
* // Log all available entity IDs
|
|
67
|
-
* client.logAllEntityIds();
|
|
68
|
-
* });
|
|
69
|
-
*
|
|
70
|
-
* // Send commands using entity IDs
|
|
71
|
-
* await client.sendSwitchCommand("switch-garagedoor", true);
|
|
72
|
-
* await client.sendLightCommand("light-light", { state: true, brightness: 0.8 });
|
|
73
|
-
* await client.sendCoverCommand("cover-door", "open");
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
export declare class EspHomeClient extends EventEmitter {
|
|
77
|
-
private clientSocket;
|
|
78
|
-
private dataListener;
|
|
79
|
-
private host;
|
|
80
|
-
private log;
|
|
81
|
-
private port;
|
|
82
|
-
private recvBuffer;
|
|
83
|
-
private remoteDeviceInfo;
|
|
84
|
-
private discoveredEntities;
|
|
85
|
-
private entityKeys;
|
|
86
|
-
private entityNames;
|
|
87
|
-
private entityTypes;
|
|
88
|
-
private protocolState;
|
|
89
|
-
private helloInitiator;
|
|
90
|
-
private messageQueue;
|
|
91
|
-
/**
|
|
92
|
-
* Creates a new ESPHome client instance.
|
|
93
|
-
*
|
|
94
|
-
* @param log - Logging interface.
|
|
95
|
-
* @param host - The hostname or IP address of the ESPHome device.
|
|
96
|
-
* @param port - The port number for the ESPHome API (default: 6053).
|
|
97
|
-
*/
|
|
98
|
-
constructor(log: HomebridgePluginLogging, host: string, port?: number);
|
|
99
|
-
/**
|
|
100
|
-
* Connect to the ESPHome device and start communication.
|
|
101
|
-
*/
|
|
102
|
-
connect(): void;
|
|
103
|
-
/**
|
|
104
|
-
* Disconnect from the ESPHome device and cleanup resources.
|
|
105
|
-
*/
|
|
106
|
-
disconnect(): void;
|
|
107
|
-
/**
|
|
108
|
-
* Handle a newly connected socket.
|
|
109
|
-
*/
|
|
110
|
-
private handleConnect;
|
|
111
|
-
/**
|
|
112
|
-
* Send the initial HELLO_REQUEST to start the handshake.
|
|
113
|
-
*/
|
|
114
|
-
private sendHelloRequest;
|
|
115
|
-
/**
|
|
116
|
-
* Verify the protocol is ready.
|
|
117
|
-
*/
|
|
118
|
-
private isReady;
|
|
119
|
-
/**
|
|
120
|
-
* Handle socket errors.
|
|
121
|
-
*/
|
|
122
|
-
private handleSocketError;
|
|
123
|
-
/**
|
|
124
|
-
* Handle socket closure.
|
|
125
|
-
*/
|
|
126
|
-
private handleSocketClose;
|
|
127
|
-
/**
|
|
128
|
-
* Clean up the data listener if it exists.
|
|
129
|
-
*/
|
|
130
|
-
private cleanupDataListener;
|
|
131
|
-
/**
|
|
132
|
-
* Handle incoming raw data, frame messages, and dispatch.
|
|
133
|
-
*/
|
|
134
|
-
private handleData;
|
|
135
|
-
/**
|
|
136
|
-
* Process a message based on current protocol state.
|
|
137
|
-
*/
|
|
138
|
-
private processMessage;
|
|
139
|
-
/**
|
|
140
|
-
* Process any queued messages after handshake completion.
|
|
141
|
-
*/
|
|
142
|
-
private processQueuedMessages;
|
|
143
|
-
/**
|
|
144
|
-
* Dispatch based on message type.
|
|
145
|
-
*/
|
|
146
|
-
private handleMessage;
|
|
147
|
-
/**
|
|
148
|
-
* Handle HELLO_REQUEST from device.
|
|
149
|
-
*/
|
|
150
|
-
private handleHelloRequest;
|
|
151
|
-
/**
|
|
152
|
-
* Handle HELLO_RESPONSE from device.
|
|
153
|
-
*/
|
|
154
|
-
private handleHelloResponse;
|
|
155
|
-
/**
|
|
156
|
-
* Send HELLO_RESPONSE.
|
|
157
|
-
*/
|
|
158
|
-
private sendHelloResponse;
|
|
159
|
-
/**
|
|
160
|
-
* Handle CONNECT_RESPONSE from device.
|
|
161
|
-
*/
|
|
162
|
-
private handleConnectResponse;
|
|
163
|
-
/**
|
|
164
|
-
* Handle device info response from the ESPHome device.
|
|
165
|
-
*/
|
|
166
|
-
private handleDeviceInfoResponse;
|
|
167
|
-
/**
|
|
168
|
-
* Return the device information of the connected ESPHome device if available.
|
|
169
|
-
*
|
|
170
|
-
* @returns The device information if available, or `null`.
|
|
171
|
-
*/
|
|
172
|
-
deviceInfo(): Nullable<DeviceInfo>;
|
|
173
|
-
/**
|
|
174
|
-
* Check if a message type is a list entities response.
|
|
175
|
-
*/
|
|
176
|
-
private isListEntitiesResponse;
|
|
177
|
-
/**
|
|
178
|
-
* Check if a message type is a state update.
|
|
179
|
-
*/
|
|
180
|
-
private isStateUpdate;
|
|
181
|
-
/**
|
|
182
|
-
* Extract entity type label from message type.
|
|
183
|
-
*/
|
|
184
|
-
private getEntityTypeLabel;
|
|
185
|
-
/**
|
|
186
|
-
* Parses a single ListEntities*Response, logs it, and stores it.
|
|
187
|
-
*/
|
|
188
|
-
private handleListEntity;
|
|
189
|
-
/**
|
|
190
|
-
* Decodes a state update, looks up entity info, and emits events.
|
|
191
|
-
*/
|
|
192
|
-
private handleTelemetry;
|
|
193
|
-
/**
|
|
194
|
-
* Handle cover state telemetry.
|
|
195
|
-
*/
|
|
196
|
-
private handleCoverState;
|
|
197
|
-
/**
|
|
198
|
-
* Extract entity key from protobuf fields.
|
|
199
|
-
*/
|
|
200
|
-
private extractEntityKey;
|
|
201
|
-
/**
|
|
202
|
-
* Extract fixed32 field from protobuf fields.
|
|
203
|
-
*/
|
|
204
|
-
private extractFixed32Field;
|
|
205
|
-
/**
|
|
206
|
-
* Extract string field from protobuf fields.
|
|
207
|
-
*/
|
|
208
|
-
private extractStringField;
|
|
209
|
-
/**
|
|
210
|
-
* Extract number field from protobuf fields.
|
|
211
|
-
*/
|
|
212
|
-
private extractNumberField;
|
|
213
|
-
/**
|
|
214
|
-
* Extract telemetry value from protobuf fields.
|
|
215
|
-
*/
|
|
216
|
-
private extractTelemetryValue;
|
|
217
|
-
/**
|
|
218
|
-
* Frames a raw protobuf payload with the 0x00 sentinel, length, and message type.
|
|
219
|
-
*/
|
|
220
|
-
private frameAndSend;
|
|
221
|
-
/**
|
|
222
|
-
* Encode protobuf fields into a buffer.
|
|
223
|
-
*/
|
|
224
|
-
private encodeProtoFields;
|
|
225
|
-
/**
|
|
226
|
-
* Build key field as fixed32 for command requests.
|
|
227
|
-
*/
|
|
228
|
-
private buildKeyField;
|
|
229
|
-
/**
|
|
230
|
-
* Get entity key by ID.
|
|
231
|
-
*
|
|
232
|
-
* @param id - The entity ID to look up.
|
|
233
|
-
*
|
|
234
|
-
* @returns The entity key or `null` if not found.
|
|
235
|
-
*/
|
|
236
|
-
getEntityKey(id: string): Nullable<number>;
|
|
237
|
-
/**
|
|
238
|
-
* Log all registered entity IDs for debugging.
|
|
239
|
-
* Logs entities grouped by type with their names and keys.
|
|
240
|
-
*/
|
|
241
|
-
logAllEntityIds(): void;
|
|
242
|
-
/**
|
|
243
|
-
* Get entity information by ID.
|
|
244
|
-
*
|
|
245
|
-
* @param id - The entity ID to look up.
|
|
246
|
-
*
|
|
247
|
-
* @returns The entity information or `null` if not found.
|
|
248
|
-
*/
|
|
249
|
-
getEntityById(id: string): Nullable<Entity>;
|
|
250
|
-
/**
|
|
251
|
-
* Check if an entity ID exists.
|
|
252
|
-
*
|
|
253
|
-
* @param id - The entity ID to check.
|
|
254
|
-
*
|
|
255
|
-
* @returns `true` if the entity exists, `false` otherwise.
|
|
256
|
-
*/
|
|
257
|
-
hasEntity(id: string): boolean;
|
|
258
|
-
/**
|
|
259
|
-
* Get all available entity IDs grouped by type.
|
|
260
|
-
*
|
|
261
|
-
* @returns Object with entity types as keys and arrays of IDs as values.
|
|
262
|
-
*/
|
|
263
|
-
getAvailableEntityIds(): Record<string, string[]>;
|
|
264
|
-
/**
|
|
265
|
-
* Get all entities with their IDs.
|
|
266
|
-
*
|
|
267
|
-
* @returns Array of entities with their corresponding IDs.
|
|
268
|
-
*/
|
|
269
|
-
getEntitiesWithIds(): Array<Entity & {
|
|
270
|
-
id: string;
|
|
271
|
-
}>;
|
|
272
|
-
/**
|
|
273
|
-
* Send a ping request to the device to heartbeat the connection.
|
|
274
|
-
*/
|
|
275
|
-
sendPing(): void;
|
|
276
|
-
/**
|
|
277
|
-
* Sends a SwitchCommandRequest for the given entity ID and on/off state.
|
|
278
|
-
*
|
|
279
|
-
* @param id - The entity ID (format: "switch-entityname").
|
|
280
|
-
* @param state - `true` for on, `false` for off.
|
|
281
|
-
*/
|
|
282
|
-
sendSwitchCommand(id: string, state: boolean): void;
|
|
283
|
-
/**
|
|
284
|
-
* Sends a ButtonCommandRequest to press a button entity.
|
|
285
|
-
*
|
|
286
|
-
* @param id - The entity ID (format: "button-entityname").
|
|
287
|
-
*/
|
|
288
|
-
sendButtonCommand(id: string): void;
|
|
289
|
-
/**
|
|
290
|
-
* Sends a CoverCommandRequest for the given entity ID.
|
|
291
|
-
*
|
|
292
|
-
* @param id - The entity ID (format: "cover-entityname").
|
|
293
|
-
* @param options - Command options (at least one option must be provided).
|
|
294
|
-
* @param options.command - The command: "open", "close", or "stop" (optional).
|
|
295
|
-
* @param options.position - Target position 0.0-1.0 where 0 is closed, 1 is open (optional).
|
|
296
|
-
* @param options.tilt - Target tilt 0.0-1.0 where 0 is closed, 1 is open (optional).
|
|
297
|
-
*
|
|
298
|
-
* @example
|
|
299
|
-
* ```typescript
|
|
300
|
-
* // Send a simple command
|
|
301
|
-
* await client.sendCoverCommand("cover-garagedoor", { command: "open" });
|
|
302
|
-
*
|
|
303
|
-
* // Set to specific position
|
|
304
|
-
* await client.sendCoverCommand("cover-garagedoor", { position: 0.5 }); // 50% open
|
|
305
|
-
*
|
|
306
|
-
* // Set position and tilt
|
|
307
|
-
* await client.sendCoverCommand("cover-blinds", { position: 1.0, tilt: 0.25 });
|
|
308
|
-
* ```
|
|
309
|
-
*/
|
|
310
|
-
sendCoverCommand(id: string, options: {
|
|
311
|
-
command?: "open" | "close" | "stop";
|
|
312
|
-
position?: number;
|
|
313
|
-
tilt?: number;
|
|
314
|
-
}): void;
|
|
315
|
-
/**
|
|
316
|
-
* Sends a LightCommandRequest to turn on/off and optionally set brightness.
|
|
317
|
-
*
|
|
318
|
-
* @param id - The entity ID (format: "light-entityname").
|
|
319
|
-
* @param options - Command options.
|
|
320
|
-
* @param options.state - `true` for on, `false` for off (optional).
|
|
321
|
-
* @param options.brightness - Brightness level 0.0-1.0 (optional).
|
|
322
|
-
*/
|
|
323
|
-
sendLightCommand(id: string, options: {
|
|
324
|
-
state?: boolean;
|
|
325
|
-
brightness?: number;
|
|
326
|
-
}): void;
|
|
327
|
-
/**
|
|
328
|
-
* Sends a LockCommandRequest to lock or unlock the given entity ID.
|
|
329
|
-
*
|
|
330
|
-
* @param id - The entity ID (format: "lock-entityname").
|
|
331
|
-
* @param command - The command to send: "lock" or "unlock".
|
|
332
|
-
* @param code - Optional unlock code.
|
|
333
|
-
*/
|
|
334
|
-
sendLockCommand(id: string, command: "lock" | "unlock", code?: string): void;
|
|
335
|
-
/**
|
|
336
|
-
* Encode an integer as a VarInt (protobuf-style).
|
|
337
|
-
*/
|
|
338
|
-
private encodeVarint;
|
|
339
|
-
/**
|
|
340
|
-
* Read a VarInt from buffer at offset; returns [value, bytesRead] or null if incomplete.
|
|
341
|
-
*/
|
|
342
|
-
private readVarint;
|
|
343
|
-
/**
|
|
344
|
-
* Decode a simple protobuf message into a map of field numbers to values.
|
|
345
|
-
*/
|
|
346
|
-
private decodeProtobuf;
|
|
347
|
-
}
|
|
348
|
-
export {};
|