@m1kad0/hannah-proto 4.8.0 → 5.0.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 +20 -12
- package/dist/compat_interceptor.js +1 -1
- package/dist/compat_versions.js +89 -89
- package/dist/descriptor.binpb +0 -0
- package/dist/index.d.ts +1 -22
- package/dist/index.js +2 -23
- package/dist/{activity_log.d.ts → v2/activity_log.d.ts} +1 -1
- package/dist/{activity_log.js → v2/activity_log.js} +2 -2
- package/dist/{agent.d.ts → v2/agent.d.ts} +61 -86
- package/dist/{agent.js → v2/agent.js} +224 -426
- package/dist/{automation.d.ts → v2/automation.d.ts} +1 -1
- package/dist/{automation.js → v2/automation.js} +2 -2
- package/dist/{car_state.d.ts → v2/car_state.d.ts} +1 -1
- package/dist/{car_state.js → v2/car_state.js} +2 -2
- package/dist/{channel.d.ts → v2/channel.d.ts} +1 -1
- package/dist/{channel.js → v2/channel.js} +2 -2
- package/dist/{control.d.ts → v2/control.d.ts} +1 -1
- package/dist/{control.js → v2/control.js} +2 -2
- package/dist/v2/device_control_menu.d.ts +67 -0
- package/dist/v2/device_control_menu.js +328 -0
- package/dist/v2/device_model.d.ts +199 -0
- package/dist/v2/device_model.js +713 -0
- package/dist/{event_stream.d.ts → v2/event_stream.d.ts} +1 -1
- package/dist/{event_stream.js → v2/event_stream.js} +2 -2
- package/dist/{hannah.d.ts → v2/hannah.d.ts} +86 -86
- package/dist/{hannah.js → v2/hannah.js} +88 -88
- package/dist/v2/index.d.ts +23 -0
- package/dist/v2/index.js +59 -0
- package/dist/{infrastructure.d.ts → v2/infrastructure.d.ts} +1 -1
- package/dist/{infrastructure.js → v2/infrastructure.js} +2 -2
- package/dist/{logging.d.ts → v2/logging.d.ts} +4 -4
- package/dist/{logging.js → v2/logging.js} +6 -6
- package/dist/{messages.d.ts → v2/messages.d.ts} +1 -1
- package/dist/{messages.js → v2/messages.js} +2 -2
- package/dist/{satellite.d.ts → v2/satellite.d.ts} +1 -1
- package/dist/{satellite.js → v2/satellite.js} +2 -2
- package/dist/{satellite_provisioning.d.ts → v2/satellite_provisioning.d.ts} +1 -1
- package/dist/{satellite_provisioning.js → v2/satellite_provisioning.js} +2 -2
- package/dist/{satellite_proxy.d.ts → v2/satellite_proxy.d.ts} +1 -1
- package/dist/{satellite_proxy.js → v2/satellite_proxy.js} +2 -2
- package/dist/{shared.d.ts → v2/shared.d.ts} +1 -28
- package/dist/v2/shared.js +113 -0
- package/dist/{speaker_enrollment.d.ts → v2/speaker_enrollment.d.ts} +1 -1
- package/dist/{speaker_enrollment.js → v2/speaker_enrollment.js} +2 -2
- package/dist/{timer_admin.d.ts → v2/timer_admin.d.ts} +1 -1
- package/dist/{timer_admin.js → v2/timer_admin.js} +2 -2
- package/dist/{timer_service.d.ts → v2/timer_service.d.ts} +1 -1
- package/dist/{timer_service.js → v2/timer_service.js} +2 -2
- package/dist/{user_registry.d.ts → v2/user_registry.d.ts} +1 -1
- package/dist/{user_registry.js → v2/user_registry.js} +2 -2
- package/dist/{wakeword_capture.d.ts → v2/wakeword_capture.d.ts} +1 -1
- package/dist/{wakeword_capture.js → v2/wakeword_capture.js} +2 -2
- package/dist/{weather.d.ts → v2/weather.d.ts} +1 -1
- package/dist/{weather.js → v2/weather.js} +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/device_control_menu.d.ts +0 -88
- package/dist/device_control_menu.js +0 -629
- package/dist/shared.js +0 -249
|
@@ -0,0 +1,713 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.1
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: hannah/v2/device_model.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.SetSlot = exports.DeviceAvailability = exports.SlotUpdate = exports.TypedDeviceSnapshot = exports.TypedDevice = exports.Slot = exports.SlotValue = exports.SlotKind = exports.DeviceClass = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
+
exports.protobufPackage = "hannah.v2";
|
|
12
|
+
/**
|
|
13
|
+
* What kind of device this is. A class exists per family of verbs, not per feature:
|
|
14
|
+
* a measuring socket is a SOCKET with a filled POWER slot, not a class of its own.
|
|
15
|
+
*/
|
|
16
|
+
var DeviceClass;
|
|
17
|
+
(function (DeviceClass) {
|
|
18
|
+
DeviceClass[DeviceClass["DEVICE_CLASS_UNSPECIFIED"] = 0] = "DEVICE_CLASS_UNSPECIFIED";
|
|
19
|
+
/** DEVICE_CLASS_LIGHT - Switchable light. Slots: ON (required), BRIGHTNESS, COLOR, COLOR_TEMPERATURE. */
|
|
20
|
+
DeviceClass[DeviceClass["DEVICE_CLASS_LIGHT"] = 1] = "DEVICE_CLASS_LIGHT";
|
|
21
|
+
/** DEVICE_CLASS_SOCKET - Socket/plug. Slots: ON (required), POWER, ENERGY, VOLTAGE, CURRENT. */
|
|
22
|
+
DeviceClass[DeviceClass["DEVICE_CLASS_SOCKET"] = 2] = "DEVICE_CLASS_SOCKET";
|
|
23
|
+
/**
|
|
24
|
+
* DEVICE_CLASS_GENERIC_BINARY_SWITCH - Any other switchable boolean that fits no other class (scene-like switches,
|
|
25
|
+
* flags, vendor specific switches). Slots: ON (required).
|
|
26
|
+
*/
|
|
27
|
+
DeviceClass[DeviceClass["DEVICE_CLASS_GENERIC_BINARY_SWITCH"] = 3] = "DEVICE_CLASS_GENERIC_BINARY_SWITCH";
|
|
28
|
+
/**
|
|
29
|
+
* DEVICE_CLASS_THERMOSTAT - Thermostat/room climate. Slots: TARGET_TEMPERATURE (required), TEMPERATURE,
|
|
30
|
+
* HUMIDITY, VALVE. Comfort/eco setpoints and similar are not slots.
|
|
31
|
+
*/
|
|
32
|
+
DeviceClass[DeviceClass["DEVICE_CLASS_THERMOSTAT"] = 4] = "DEVICE_CLASS_THERMOSTAT";
|
|
33
|
+
/** DEVICE_CLASS_COVER - Blind, shutter, awning. Slots: POSITION (required), TILT, STOP. */
|
|
34
|
+
DeviceClass[DeviceClass["DEVICE_CLASS_COVER"] = 5] = "DEVICE_CLASS_COVER";
|
|
35
|
+
/**
|
|
36
|
+
* DEVICE_CLASS_SENSOR - Read-only measurements. At least one measurement slot: TEMPERATURE, HUMIDITY,
|
|
37
|
+
* ILLUMINANCE, PRESSURE, CO2, IAQ, VOC, POWER, ENERGY, MOTION.
|
|
38
|
+
*/
|
|
39
|
+
DeviceClass[DeviceClass["DEVICE_CLASS_SENSOR"] = 6] = "DEVICE_CLASS_SENSOR";
|
|
40
|
+
/** DEVICE_CLASS_CONTACT - Door or window contact. Slots: OPEN (required, read-only). */
|
|
41
|
+
DeviceClass[DeviceClass["DEVICE_CLASS_CONTACT"] = 7] = "DEVICE_CLASS_CONTACT";
|
|
42
|
+
/**
|
|
43
|
+
* DEVICE_CLASS_GENERIC - Fallback for anything that matches no class: a list of typed values
|
|
44
|
+
* (GENERIC_NUMBER / GENERIC_BOOL / GENERIC_TEXT), each with label and unit.
|
|
45
|
+
*/
|
|
46
|
+
DeviceClass[DeviceClass["DEVICE_CLASS_GENERIC"] = 8] = "DEVICE_CLASS_GENERIC";
|
|
47
|
+
DeviceClass[DeviceClass["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
48
|
+
})(DeviceClass || (exports.DeviceClass = DeviceClass = {}));
|
|
49
|
+
/**
|
|
50
|
+
* What a slot means, and therefore which scale and unit its value has. The adapter
|
|
51
|
+
* normalizes every value to exactly this scale; Core relies on it.
|
|
52
|
+
*/
|
|
53
|
+
var SlotKind;
|
|
54
|
+
(function (SlotKind) {
|
|
55
|
+
SlotKind[SlotKind["SLOT_KIND_UNSPECIFIED"] = 0] = "SLOT_KIND_UNSPECIFIED";
|
|
56
|
+
/** SLOT_KIND_ON - --- switching and light --- */
|
|
57
|
+
SlotKind[SlotKind["SLOT_KIND_ON"] = 1] = "SLOT_KIND_ON";
|
|
58
|
+
/** SLOT_KIND_BRIGHTNESS - number, 0-100 (%) */
|
|
59
|
+
SlotKind[SlotKind["SLOT_KIND_BRIGHTNESS"] = 2] = "SLOT_KIND_BRIGHTNESS";
|
|
60
|
+
/** SLOT_KIND_COLOR - rgb, 0xRRGGBB */
|
|
61
|
+
SlotKind[SlotKind["SLOT_KIND_COLOR"] = 3] = "SLOT_KIND_COLOR";
|
|
62
|
+
/** SLOT_KIND_COLOR_TEMPERATURE - number, Kelvin (e.g. 2700 warm white, 6500 cold white) */
|
|
63
|
+
SlotKind[SlotKind["SLOT_KIND_COLOR_TEMPERATURE"] = 4] = "SLOT_KIND_COLOR_TEMPERATURE";
|
|
64
|
+
/** SLOT_KIND_POWER - --- electricity --- */
|
|
65
|
+
SlotKind[SlotKind["SLOT_KIND_POWER"] = 10] = "SLOT_KIND_POWER";
|
|
66
|
+
/** SLOT_KIND_ENERGY - number, kWh (cumulative) */
|
|
67
|
+
SlotKind[SlotKind["SLOT_KIND_ENERGY"] = 11] = "SLOT_KIND_ENERGY";
|
|
68
|
+
/** SLOT_KIND_VOLTAGE - number, V */
|
|
69
|
+
SlotKind[SlotKind["SLOT_KIND_VOLTAGE"] = 12] = "SLOT_KIND_VOLTAGE";
|
|
70
|
+
/** SLOT_KIND_CURRENT - number, A */
|
|
71
|
+
SlotKind[SlotKind["SLOT_KIND_CURRENT"] = 13] = "SLOT_KIND_CURRENT";
|
|
72
|
+
/** SLOT_KIND_TARGET_TEMPERATURE - --- climate --- */
|
|
73
|
+
SlotKind[SlotKind["SLOT_KIND_TARGET_TEMPERATURE"] = 20] = "SLOT_KIND_TARGET_TEMPERATURE";
|
|
74
|
+
/** SLOT_KIND_TEMPERATURE - number, °C, measured value */
|
|
75
|
+
SlotKind[SlotKind["SLOT_KIND_TEMPERATURE"] = 21] = "SLOT_KIND_TEMPERATURE";
|
|
76
|
+
/** SLOT_KIND_HUMIDITY - number, 0-100 (% relative) */
|
|
77
|
+
SlotKind[SlotKind["SLOT_KIND_HUMIDITY"] = 22] = "SLOT_KIND_HUMIDITY";
|
|
78
|
+
/** SLOT_KIND_VALVE - number, 0-100 (% open) */
|
|
79
|
+
SlotKind[SlotKind["SLOT_KIND_VALVE"] = 23] = "SLOT_KIND_VALVE";
|
|
80
|
+
/** SLOT_KIND_POSITION - --- cover --- */
|
|
81
|
+
SlotKind[SlotKind["SLOT_KIND_POSITION"] = 30] = "SLOT_KIND_POSITION";
|
|
82
|
+
/** SLOT_KIND_TILT - number, 0-100 (%) */
|
|
83
|
+
SlotKind[SlotKind["SLOT_KIND_TILT"] = 31] = "SLOT_KIND_TILT";
|
|
84
|
+
/** SLOT_KIND_STOP - boolean trigger: true = stop movement, not a state */
|
|
85
|
+
SlotKind[SlotKind["SLOT_KIND_STOP"] = 32] = "SLOT_KIND_STOP";
|
|
86
|
+
/** SLOT_KIND_OPEN - --- binary sensors --- */
|
|
87
|
+
SlotKind[SlotKind["SLOT_KIND_OPEN"] = 40] = "SLOT_KIND_OPEN";
|
|
88
|
+
/** SLOT_KIND_MOTION - boolean: true = motion/presence detected */
|
|
89
|
+
SlotKind[SlotKind["SLOT_KIND_MOTION"] = 41] = "SLOT_KIND_MOTION";
|
|
90
|
+
/** SLOT_KIND_ILLUMINANCE - --- further measurements --- */
|
|
91
|
+
SlotKind[SlotKind["SLOT_KIND_ILLUMINANCE"] = 50] = "SLOT_KIND_ILLUMINANCE";
|
|
92
|
+
/** SLOT_KIND_PRESSURE - number, hPa */
|
|
93
|
+
SlotKind[SlotKind["SLOT_KIND_PRESSURE"] = 51] = "SLOT_KIND_PRESSURE";
|
|
94
|
+
/** SLOT_KIND_CO2 - number, ppm */
|
|
95
|
+
SlotKind[SlotKind["SLOT_KIND_CO2"] = 52] = "SLOT_KIND_CO2";
|
|
96
|
+
/** SLOT_KIND_IAQ - number, index 0-500 */
|
|
97
|
+
SlotKind[SlotKind["SLOT_KIND_IAQ"] = 53] = "SLOT_KIND_IAQ";
|
|
98
|
+
/** SLOT_KIND_VOC - number, ppm */
|
|
99
|
+
SlotKind[SlotKind["SLOT_KIND_VOC"] = 54] = "SLOT_KIND_VOC";
|
|
100
|
+
/** SLOT_KIND_GENERIC_NUMBER - --- generic values (DEVICE_CLASS_GENERIC), described by label and unit --- */
|
|
101
|
+
SlotKind[SlotKind["SLOT_KIND_GENERIC_NUMBER"] = 90] = "SLOT_KIND_GENERIC_NUMBER";
|
|
102
|
+
SlotKind[SlotKind["SLOT_KIND_GENERIC_BOOL"] = 91] = "SLOT_KIND_GENERIC_BOOL";
|
|
103
|
+
SlotKind[SlotKind["SLOT_KIND_GENERIC_TEXT"] = 92] = "SLOT_KIND_GENERIC_TEXT";
|
|
104
|
+
SlotKind[SlotKind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
105
|
+
})(SlotKind || (exports.SlotKind = SlotKind = {}));
|
|
106
|
+
function createBaseSlotValue() {
|
|
107
|
+
return { boolean: undefined, number: undefined, text: undefined, rgb: undefined };
|
|
108
|
+
}
|
|
109
|
+
exports.SlotValue = {
|
|
110
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
111
|
+
if (message.boolean !== undefined) {
|
|
112
|
+
writer.uint32(8).bool(message.boolean);
|
|
113
|
+
}
|
|
114
|
+
if (message.number !== undefined) {
|
|
115
|
+
writer.uint32(17).double(message.number);
|
|
116
|
+
}
|
|
117
|
+
if (message.text !== undefined) {
|
|
118
|
+
writer.uint32(26).string(message.text);
|
|
119
|
+
}
|
|
120
|
+
if (message.rgb !== undefined) {
|
|
121
|
+
writer.uint32(32).uint32(message.rgb);
|
|
122
|
+
}
|
|
123
|
+
return writer;
|
|
124
|
+
},
|
|
125
|
+
decode(input, length) {
|
|
126
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
127
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
128
|
+
if (previousRecursionDepth >= 100) {
|
|
129
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
130
|
+
}
|
|
131
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
132
|
+
try {
|
|
133
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
134
|
+
const message = createBaseSlotValue();
|
|
135
|
+
while (reader.pos < end) {
|
|
136
|
+
const tag = reader.uint32();
|
|
137
|
+
switch (tag >>> 3) {
|
|
138
|
+
case 1: {
|
|
139
|
+
if (tag !== 8) {
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
message.boolean = reader.bool();
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
case 2: {
|
|
146
|
+
if (tag !== 17) {
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
message.number = reader.double();
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
case 3: {
|
|
153
|
+
if (tag !== 26) {
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
message.text = reader.string();
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
case 4: {
|
|
160
|
+
if (tag !== 32) {
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
message.rgb = reader.uint32();
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
reader.skip(tag & 7);
|
|
171
|
+
}
|
|
172
|
+
return message;
|
|
173
|
+
}
|
|
174
|
+
finally {
|
|
175
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
create(base) {
|
|
179
|
+
return exports.SlotValue.fromPartial(base ?? {});
|
|
180
|
+
},
|
|
181
|
+
fromPartial(object) {
|
|
182
|
+
const message = createBaseSlotValue();
|
|
183
|
+
message.boolean = object.boolean ?? undefined;
|
|
184
|
+
message.number = object.number ?? undefined;
|
|
185
|
+
message.text = object.text ?? undefined;
|
|
186
|
+
message.rgb = object.rgb ?? undefined;
|
|
187
|
+
return message;
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
function createBaseSlot() {
|
|
191
|
+
return { slotId: "", kind: 0, value: undefined, writable: false, unit: "", label: "", requiredTrustLevel: undefined };
|
|
192
|
+
}
|
|
193
|
+
exports.Slot = {
|
|
194
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
195
|
+
if (message.slotId !== "") {
|
|
196
|
+
writer.uint32(10).string(message.slotId);
|
|
197
|
+
}
|
|
198
|
+
if (message.kind !== 0) {
|
|
199
|
+
writer.uint32(16).int32(message.kind);
|
|
200
|
+
}
|
|
201
|
+
if (message.value !== undefined) {
|
|
202
|
+
exports.SlotValue.encode(message.value, writer.uint32(26).fork()).join();
|
|
203
|
+
}
|
|
204
|
+
if (message.writable !== false) {
|
|
205
|
+
writer.uint32(32).bool(message.writable);
|
|
206
|
+
}
|
|
207
|
+
if (message.unit !== "") {
|
|
208
|
+
writer.uint32(42).string(message.unit);
|
|
209
|
+
}
|
|
210
|
+
if (message.label !== "") {
|
|
211
|
+
writer.uint32(50).string(message.label);
|
|
212
|
+
}
|
|
213
|
+
if (message.requiredTrustLevel !== undefined) {
|
|
214
|
+
writer.uint32(56).int32(message.requiredTrustLevel);
|
|
215
|
+
}
|
|
216
|
+
return writer;
|
|
217
|
+
},
|
|
218
|
+
decode(input, length) {
|
|
219
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
220
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
221
|
+
if (previousRecursionDepth >= 100) {
|
|
222
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
223
|
+
}
|
|
224
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
225
|
+
try {
|
|
226
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
227
|
+
const message = createBaseSlot();
|
|
228
|
+
while (reader.pos < end) {
|
|
229
|
+
const tag = reader.uint32();
|
|
230
|
+
switch (tag >>> 3) {
|
|
231
|
+
case 1: {
|
|
232
|
+
if (tag !== 10) {
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
message.slotId = reader.string();
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
case 2: {
|
|
239
|
+
if (tag !== 16) {
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
message.kind = reader.int32();
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
case 3: {
|
|
246
|
+
if (tag !== 26) {
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
message.value = exports.SlotValue.decode(reader, reader.uint32());
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
case 4: {
|
|
253
|
+
if (tag !== 32) {
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
message.writable = reader.bool();
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
case 5: {
|
|
260
|
+
if (tag !== 42) {
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
message.unit = reader.string();
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
case 6: {
|
|
267
|
+
if (tag !== 50) {
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
message.label = reader.string();
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
case 7: {
|
|
274
|
+
if (tag !== 56) {
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
message.requiredTrustLevel = reader.int32();
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
reader.skip(tag & 7);
|
|
285
|
+
}
|
|
286
|
+
return message;
|
|
287
|
+
}
|
|
288
|
+
finally {
|
|
289
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
create(base) {
|
|
293
|
+
return exports.Slot.fromPartial(base ?? {});
|
|
294
|
+
},
|
|
295
|
+
fromPartial(object) {
|
|
296
|
+
const message = createBaseSlot();
|
|
297
|
+
message.slotId = object.slotId ?? "";
|
|
298
|
+
message.kind = object.kind ?? 0;
|
|
299
|
+
message.value = (object.value !== undefined && object.value !== null)
|
|
300
|
+
? exports.SlotValue.fromPartial(object.value)
|
|
301
|
+
: undefined;
|
|
302
|
+
message.writable = object.writable ?? false;
|
|
303
|
+
message.unit = object.unit ?? "";
|
|
304
|
+
message.label = object.label ?? "";
|
|
305
|
+
message.requiredTrustLevel = object.requiredTrustLevel ?? undefined;
|
|
306
|
+
return message;
|
|
307
|
+
},
|
|
308
|
+
};
|
|
309
|
+
function createBaseTypedDevice() {
|
|
310
|
+
return { deviceId: "", name: "", room: "", floor: "", deviceClass: 0, slots: [], available: false };
|
|
311
|
+
}
|
|
312
|
+
exports.TypedDevice = {
|
|
313
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
314
|
+
if (message.deviceId !== "") {
|
|
315
|
+
writer.uint32(10).string(message.deviceId);
|
|
316
|
+
}
|
|
317
|
+
if (message.name !== "") {
|
|
318
|
+
writer.uint32(18).string(message.name);
|
|
319
|
+
}
|
|
320
|
+
if (message.room !== "") {
|
|
321
|
+
writer.uint32(26).string(message.room);
|
|
322
|
+
}
|
|
323
|
+
if (message.floor !== "") {
|
|
324
|
+
writer.uint32(34).string(message.floor);
|
|
325
|
+
}
|
|
326
|
+
if (message.deviceClass !== 0) {
|
|
327
|
+
writer.uint32(40).int32(message.deviceClass);
|
|
328
|
+
}
|
|
329
|
+
for (const v of message.slots) {
|
|
330
|
+
exports.Slot.encode(v, writer.uint32(50).fork()).join();
|
|
331
|
+
}
|
|
332
|
+
if (message.available !== false) {
|
|
333
|
+
writer.uint32(56).bool(message.available);
|
|
334
|
+
}
|
|
335
|
+
return writer;
|
|
336
|
+
},
|
|
337
|
+
decode(input, length) {
|
|
338
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
339
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
340
|
+
if (previousRecursionDepth >= 100) {
|
|
341
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
342
|
+
}
|
|
343
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
344
|
+
try {
|
|
345
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
346
|
+
const message = createBaseTypedDevice();
|
|
347
|
+
while (reader.pos < end) {
|
|
348
|
+
const tag = reader.uint32();
|
|
349
|
+
switch (tag >>> 3) {
|
|
350
|
+
case 1: {
|
|
351
|
+
if (tag !== 10) {
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
message.deviceId = reader.string();
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
357
|
+
case 2: {
|
|
358
|
+
if (tag !== 18) {
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
message.name = reader.string();
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
case 3: {
|
|
365
|
+
if (tag !== 26) {
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
message.room = reader.string();
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
371
|
+
case 4: {
|
|
372
|
+
if (tag !== 34) {
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
message.floor = reader.string();
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
case 5: {
|
|
379
|
+
if (tag !== 40) {
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
message.deviceClass = reader.int32();
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
case 6: {
|
|
386
|
+
if (tag !== 50) {
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
message.slots.push(exports.Slot.decode(reader, reader.uint32()));
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
case 7: {
|
|
393
|
+
if (tag !== 56) {
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
396
|
+
message.available = reader.bool();
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
reader.skip(tag & 7);
|
|
404
|
+
}
|
|
405
|
+
return message;
|
|
406
|
+
}
|
|
407
|
+
finally {
|
|
408
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
create(base) {
|
|
412
|
+
return exports.TypedDevice.fromPartial(base ?? {});
|
|
413
|
+
},
|
|
414
|
+
fromPartial(object) {
|
|
415
|
+
const message = createBaseTypedDevice();
|
|
416
|
+
message.deviceId = object.deviceId ?? "";
|
|
417
|
+
message.name = object.name ?? "";
|
|
418
|
+
message.room = object.room ?? "";
|
|
419
|
+
message.floor = object.floor ?? "";
|
|
420
|
+
message.deviceClass = object.deviceClass ?? 0;
|
|
421
|
+
message.slots = object.slots?.map((e) => exports.Slot.fromPartial(e)) || [];
|
|
422
|
+
message.available = object.available ?? false;
|
|
423
|
+
return message;
|
|
424
|
+
},
|
|
425
|
+
};
|
|
426
|
+
function createBaseTypedDeviceSnapshot() {
|
|
427
|
+
return { devices: [] };
|
|
428
|
+
}
|
|
429
|
+
exports.TypedDeviceSnapshot = {
|
|
430
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
431
|
+
for (const v of message.devices) {
|
|
432
|
+
exports.TypedDevice.encode(v, writer.uint32(10).fork()).join();
|
|
433
|
+
}
|
|
434
|
+
return writer;
|
|
435
|
+
},
|
|
436
|
+
decode(input, length) {
|
|
437
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
438
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
439
|
+
if (previousRecursionDepth >= 100) {
|
|
440
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
441
|
+
}
|
|
442
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
443
|
+
try {
|
|
444
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
445
|
+
const message = createBaseTypedDeviceSnapshot();
|
|
446
|
+
while (reader.pos < end) {
|
|
447
|
+
const tag = reader.uint32();
|
|
448
|
+
switch (tag >>> 3) {
|
|
449
|
+
case 1: {
|
|
450
|
+
if (tag !== 10) {
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
message.devices.push(exports.TypedDevice.decode(reader, reader.uint32()));
|
|
454
|
+
continue;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
458
|
+
break;
|
|
459
|
+
}
|
|
460
|
+
reader.skip(tag & 7);
|
|
461
|
+
}
|
|
462
|
+
return message;
|
|
463
|
+
}
|
|
464
|
+
finally {
|
|
465
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
create(base) {
|
|
469
|
+
return exports.TypedDeviceSnapshot.fromPartial(base ?? {});
|
|
470
|
+
},
|
|
471
|
+
fromPartial(object) {
|
|
472
|
+
const message = createBaseTypedDeviceSnapshot();
|
|
473
|
+
message.devices = object.devices?.map((e) => exports.TypedDevice.fromPartial(e)) || [];
|
|
474
|
+
return message;
|
|
475
|
+
},
|
|
476
|
+
};
|
|
477
|
+
function createBaseSlotUpdate() {
|
|
478
|
+
return { deviceId: "", slotId: "", value: undefined, ack: false, ts: 0n };
|
|
479
|
+
}
|
|
480
|
+
exports.SlotUpdate = {
|
|
481
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
482
|
+
if (message.deviceId !== "") {
|
|
483
|
+
writer.uint32(10).string(message.deviceId);
|
|
484
|
+
}
|
|
485
|
+
if (message.slotId !== "") {
|
|
486
|
+
writer.uint32(18).string(message.slotId);
|
|
487
|
+
}
|
|
488
|
+
if (message.value !== undefined) {
|
|
489
|
+
exports.SlotValue.encode(message.value, writer.uint32(26).fork()).join();
|
|
490
|
+
}
|
|
491
|
+
if (message.ack !== false) {
|
|
492
|
+
writer.uint32(32).bool(message.ack);
|
|
493
|
+
}
|
|
494
|
+
if (message.ts !== 0n) {
|
|
495
|
+
if (BigInt.asIntN(64, message.ts) !== message.ts) {
|
|
496
|
+
throw new globalThis.Error("value provided for field message.ts of type int64 too large");
|
|
497
|
+
}
|
|
498
|
+
writer.uint32(40).int64(message.ts);
|
|
499
|
+
}
|
|
500
|
+
return writer;
|
|
501
|
+
},
|
|
502
|
+
decode(input, length) {
|
|
503
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
504
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
505
|
+
if (previousRecursionDepth >= 100) {
|
|
506
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
507
|
+
}
|
|
508
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
509
|
+
try {
|
|
510
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
511
|
+
const message = createBaseSlotUpdate();
|
|
512
|
+
while (reader.pos < end) {
|
|
513
|
+
const tag = reader.uint32();
|
|
514
|
+
switch (tag >>> 3) {
|
|
515
|
+
case 1: {
|
|
516
|
+
if (tag !== 10) {
|
|
517
|
+
break;
|
|
518
|
+
}
|
|
519
|
+
message.deviceId = reader.string();
|
|
520
|
+
continue;
|
|
521
|
+
}
|
|
522
|
+
case 2: {
|
|
523
|
+
if (tag !== 18) {
|
|
524
|
+
break;
|
|
525
|
+
}
|
|
526
|
+
message.slotId = reader.string();
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
case 3: {
|
|
530
|
+
if (tag !== 26) {
|
|
531
|
+
break;
|
|
532
|
+
}
|
|
533
|
+
message.value = exports.SlotValue.decode(reader, reader.uint32());
|
|
534
|
+
continue;
|
|
535
|
+
}
|
|
536
|
+
case 4: {
|
|
537
|
+
if (tag !== 32) {
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
message.ack = reader.bool();
|
|
541
|
+
continue;
|
|
542
|
+
}
|
|
543
|
+
case 5: {
|
|
544
|
+
if (tag !== 40) {
|
|
545
|
+
break;
|
|
546
|
+
}
|
|
547
|
+
message.ts = reader.int64();
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
552
|
+
break;
|
|
553
|
+
}
|
|
554
|
+
reader.skip(tag & 7);
|
|
555
|
+
}
|
|
556
|
+
return message;
|
|
557
|
+
}
|
|
558
|
+
finally {
|
|
559
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
create(base) {
|
|
563
|
+
return exports.SlotUpdate.fromPartial(base ?? {});
|
|
564
|
+
},
|
|
565
|
+
fromPartial(object) {
|
|
566
|
+
const message = createBaseSlotUpdate();
|
|
567
|
+
message.deviceId = object.deviceId ?? "";
|
|
568
|
+
message.slotId = object.slotId ?? "";
|
|
569
|
+
message.value = (object.value !== undefined && object.value !== null)
|
|
570
|
+
? exports.SlotValue.fromPartial(object.value)
|
|
571
|
+
: undefined;
|
|
572
|
+
message.ack = object.ack ?? false;
|
|
573
|
+
message.ts = (object.ts !== undefined && object.ts !== null) ? BigInt(object.ts) : 0n;
|
|
574
|
+
return message;
|
|
575
|
+
},
|
|
576
|
+
};
|
|
577
|
+
function createBaseDeviceAvailability() {
|
|
578
|
+
return { deviceId: "", available: false };
|
|
579
|
+
}
|
|
580
|
+
exports.DeviceAvailability = {
|
|
581
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
582
|
+
if (message.deviceId !== "") {
|
|
583
|
+
writer.uint32(10).string(message.deviceId);
|
|
584
|
+
}
|
|
585
|
+
if (message.available !== false) {
|
|
586
|
+
writer.uint32(16).bool(message.available);
|
|
587
|
+
}
|
|
588
|
+
return writer;
|
|
589
|
+
},
|
|
590
|
+
decode(input, length) {
|
|
591
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
592
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
593
|
+
if (previousRecursionDepth >= 100) {
|
|
594
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
595
|
+
}
|
|
596
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
597
|
+
try {
|
|
598
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
599
|
+
const message = createBaseDeviceAvailability();
|
|
600
|
+
while (reader.pos < end) {
|
|
601
|
+
const tag = reader.uint32();
|
|
602
|
+
switch (tag >>> 3) {
|
|
603
|
+
case 1: {
|
|
604
|
+
if (tag !== 10) {
|
|
605
|
+
break;
|
|
606
|
+
}
|
|
607
|
+
message.deviceId = reader.string();
|
|
608
|
+
continue;
|
|
609
|
+
}
|
|
610
|
+
case 2: {
|
|
611
|
+
if (tag !== 16) {
|
|
612
|
+
break;
|
|
613
|
+
}
|
|
614
|
+
message.available = reader.bool();
|
|
615
|
+
continue;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
619
|
+
break;
|
|
620
|
+
}
|
|
621
|
+
reader.skip(tag & 7);
|
|
622
|
+
}
|
|
623
|
+
return message;
|
|
624
|
+
}
|
|
625
|
+
finally {
|
|
626
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
create(base) {
|
|
630
|
+
return exports.DeviceAvailability.fromPartial(base ?? {});
|
|
631
|
+
},
|
|
632
|
+
fromPartial(object) {
|
|
633
|
+
const message = createBaseDeviceAvailability();
|
|
634
|
+
message.deviceId = object.deviceId ?? "";
|
|
635
|
+
message.available = object.available ?? false;
|
|
636
|
+
return message;
|
|
637
|
+
},
|
|
638
|
+
};
|
|
639
|
+
function createBaseSetSlot() {
|
|
640
|
+
return { deviceId: "", slotId: "", value: undefined };
|
|
641
|
+
}
|
|
642
|
+
exports.SetSlot = {
|
|
643
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
644
|
+
if (message.deviceId !== "") {
|
|
645
|
+
writer.uint32(10).string(message.deviceId);
|
|
646
|
+
}
|
|
647
|
+
if (message.slotId !== "") {
|
|
648
|
+
writer.uint32(18).string(message.slotId);
|
|
649
|
+
}
|
|
650
|
+
if (message.value !== undefined) {
|
|
651
|
+
exports.SlotValue.encode(message.value, writer.uint32(26).fork()).join();
|
|
652
|
+
}
|
|
653
|
+
return writer;
|
|
654
|
+
},
|
|
655
|
+
decode(input, length) {
|
|
656
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
657
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
658
|
+
if (previousRecursionDepth >= 100) {
|
|
659
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
660
|
+
}
|
|
661
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
662
|
+
try {
|
|
663
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
664
|
+
const message = createBaseSetSlot();
|
|
665
|
+
while (reader.pos < end) {
|
|
666
|
+
const tag = reader.uint32();
|
|
667
|
+
switch (tag >>> 3) {
|
|
668
|
+
case 1: {
|
|
669
|
+
if (tag !== 10) {
|
|
670
|
+
break;
|
|
671
|
+
}
|
|
672
|
+
message.deviceId = reader.string();
|
|
673
|
+
continue;
|
|
674
|
+
}
|
|
675
|
+
case 2: {
|
|
676
|
+
if (tag !== 18) {
|
|
677
|
+
break;
|
|
678
|
+
}
|
|
679
|
+
message.slotId = reader.string();
|
|
680
|
+
continue;
|
|
681
|
+
}
|
|
682
|
+
case 3: {
|
|
683
|
+
if (tag !== 26) {
|
|
684
|
+
break;
|
|
685
|
+
}
|
|
686
|
+
message.value = exports.SlotValue.decode(reader, reader.uint32());
|
|
687
|
+
continue;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
691
|
+
break;
|
|
692
|
+
}
|
|
693
|
+
reader.skip(tag & 7);
|
|
694
|
+
}
|
|
695
|
+
return message;
|
|
696
|
+
}
|
|
697
|
+
finally {
|
|
698
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
699
|
+
}
|
|
700
|
+
},
|
|
701
|
+
create(base) {
|
|
702
|
+
return exports.SetSlot.fromPartial(base ?? {});
|
|
703
|
+
},
|
|
704
|
+
fromPartial(object) {
|
|
705
|
+
const message = createBaseSetSlot();
|
|
706
|
+
message.deviceId = object.deviceId ?? "";
|
|
707
|
+
message.slotId = object.slotId ?? "";
|
|
708
|
+
message.value = (object.value !== undefined && object.value !== null)
|
|
709
|
+
? exports.SlotValue.fromPartial(object.value)
|
|
710
|
+
: undefined;
|
|
711
|
+
return message;
|
|
712
|
+
},
|
|
713
|
+
};
|