@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
-
export declare const protobufPackage = "hannah";
|
|
2
|
+
export declare const protobufPackage = "hannah.v2";
|
|
3
3
|
/** Sent by an automation service (e.g. telegram_autoresponder) over the AutomationConnect stream. */
|
|
4
4
|
export interface AutomationMessage {
|
|
5
5
|
/** sent once, right after connecting */
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// versions:
|
|
4
4
|
// protoc-gen-ts_proto v2.12.1
|
|
5
5
|
// protoc unknown
|
|
6
|
-
// source: hannah/automation.proto
|
|
6
|
+
// source: hannah/v2/automation.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.AutomationStateChanged = exports.AutomationSnapshot = exports.AutomationCommand = exports.AutomationRegister = exports.AutomationMessage = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
-
exports.protobufPackage = "hannah";
|
|
11
|
+
exports.protobufPackage = "hannah.v2";
|
|
12
12
|
function createBaseAutomationMessage() {
|
|
13
13
|
return { register: undefined };
|
|
14
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
-
export declare const protobufPackage = "hannah";
|
|
2
|
+
export declare const protobufPackage = "hannah.v2";
|
|
3
3
|
export interface CarStateResponse {
|
|
4
4
|
/** false if no MQTT data received yet */
|
|
5
5
|
available: boolean;
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// versions:
|
|
4
4
|
// protoc-gen-ts_proto v2.12.1
|
|
5
5
|
// protoc unknown
|
|
6
|
-
// source: hannah/car_state.proto
|
|
6
|
+
// source: hannah/v2/car_state.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.CarStateProto_WindowsEntry = exports.CarStateProto_DoorsEntry = exports.CarStateProto = exports.GetAllCarStatesResponse = exports.CarStateResponse = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
-
exports.protobufPackage = "hannah";
|
|
11
|
+
exports.protobufPackage = "hannah.v2";
|
|
12
12
|
function createBaseCarStateResponse() {
|
|
13
13
|
return { available: false, state: undefined };
|
|
14
14
|
}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// versions:
|
|
4
4
|
// protoc-gen-ts_proto v2.12.1
|
|
5
5
|
// protoc unknown
|
|
6
|
-
// source: hannah/channel.proto
|
|
6
|
+
// source: hannah/v2/channel.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.GetChannelsResponse = exports.ChannelInfo = exports.RedeemLinkTokenResult = exports.ChannelRegistered = exports.ChannelCommand = exports.RedeemLinkToken = exports.ChannelRegister = exports.ChannelMessage = exports.RedeemResult = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
-
exports.protobufPackage = "hannah";
|
|
11
|
+
exports.protobufPackage = "hannah.v2";
|
|
12
12
|
var RedeemResult;
|
|
13
13
|
(function (RedeemResult) {
|
|
14
14
|
RedeemResult[RedeemResult["REDEEM_RESULT_UNSPECIFIED"] = 0] = "REDEEM_RESULT_UNSPECIFIED";
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// versions:
|
|
4
4
|
// protoc-gen-ts_proto v2.12.1
|
|
5
5
|
// protoc unknown
|
|
6
|
-
// source: hannah/control.proto
|
|
6
|
+
// source: hannah/v2/control.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.DeleteCarRequest = exports.UpdateCarRequest = exports.CreateCarResponse = exports.CreateCarRequest = exports.GetCarsResponse = exports.Car = exports.DeletePresenceSourceRequest = exports.UpdatePresenceSourceRequest = exports.CreatePresenceSourceResponse = exports.CreatePresenceSourceRequest = exports.GetPresenceSourcesResponse = exports.PresenceSource = exports.DeleteBleTagRequest = exports.UpdateBleTagRequest = exports.CreateBleTagResponse = exports.CreateBleTagRequest = exports.GetBleTagsResponse = exports.BleTag = exports.UpdateConfigRequest = exports.SettingUpdate = exports.GetSettingsResponse = exports.Setting = exports.Category = exports.DeleteAlarmRequest = exports.UpdateAlarmRequest = exports.CreateAlarmResponse = exports.CreateAlarmRequest = exports.GetAlarmsResponse = exports.Alarm = exports.DeleteTriggerRequest = exports.UpdateTriggerRequest = exports.CreateTriggerRequest = exports.GetTriggersResponse = exports.Trigger = exports.SetGroupSatellitesRequest = exports.DeleteGroupRequest = exports.UpdateGroupRequest = exports.CreateGroupRequest = exports.GetGroupsResponse = exports.Group = exports.GroupSatellite = exports.GetRoomsResponse = exports.Room = exports.AnnounceRequest = exports.SubmitVoiceResponse = exports.SubmitVoiceRequest = exports.SubmitTextResponse = exports.SubmitTextRequest = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
-
exports.protobufPackage = "hannah";
|
|
11
|
+
exports.protobufPackage = "hannah.v2";
|
|
12
12
|
function createBaseSubmitTextRequest() {
|
|
13
13
|
return { text: "", sourceService: "", sourceUserId: "" };
|
|
14
14
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { DeviceClass, Slot, SlotValue } from "./device_model";
|
|
3
|
+
export declare const protobufPackage = "hannah.v2";
|
|
4
|
+
/**
|
|
5
|
+
* A device for control menus (WebUI, Telegram), in the typed device model: the class
|
|
6
|
+
* says what it is, the slots carry its current values and what can be controlled.
|
|
7
|
+
* Field numbers 3-8 are intentionally unused: the previous generation's DeviceInfo
|
|
8
|
+
* used them for state-based data with other types.
|
|
9
|
+
*/
|
|
10
|
+
export interface DeviceInfo {
|
|
11
|
+
/** TypedDevice.device_id */
|
|
12
|
+
id: string;
|
|
13
|
+
/** display name, e.g. "DeckeSeite" */
|
|
14
|
+
name: string;
|
|
15
|
+
deviceClass: DeviceClass;
|
|
16
|
+
/** with current values; Slot.writable says what a menu may offer */
|
|
17
|
+
slots: Slot[];
|
|
18
|
+
available: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface RoomInfo {
|
|
21
|
+
/** room_id (lowercase), e.g. "wohnzimmer" */
|
|
22
|
+
key: string;
|
|
23
|
+
/** display name, e.g. "Wohnzimmer" */
|
|
24
|
+
name: string;
|
|
25
|
+
devices: DeviceInfo[];
|
|
26
|
+
}
|
|
27
|
+
export interface GetDevicesResponse {
|
|
28
|
+
rooms: RoomInfo[];
|
|
29
|
+
}
|
|
30
|
+
/** Direct control of one slot, bypassing the NLU. */
|
|
31
|
+
export interface ControlDeviceRequest {
|
|
32
|
+
/** DeviceInfo.id */
|
|
33
|
+
deviceId: string;
|
|
34
|
+
/** Slot.slot_id, e.g. "on", "brightness" */
|
|
35
|
+
slotId: string;
|
|
36
|
+
/**
|
|
37
|
+
* The calling service and its user, same as SubmitTextRequest: Core looks up
|
|
38
|
+
* the user via linked_accounts to check Slot.required_trust_level.
|
|
39
|
+
* Unset or not linked = guest (trust level 0).
|
|
40
|
+
*/
|
|
41
|
+
sourceService: string;
|
|
42
|
+
/** e.g. Telegram chat_id as string */
|
|
43
|
+
sourceUserId: string;
|
|
44
|
+
/** the value in the slot's documented scale (see SlotKind) */
|
|
45
|
+
value: SlotValue | undefined;
|
|
46
|
+
}
|
|
47
|
+
export declare const DeviceInfo: MessageFns<DeviceInfo>;
|
|
48
|
+
export declare const RoomInfo: MessageFns<RoomInfo>;
|
|
49
|
+
export declare const GetDevicesResponse: MessageFns<GetDevicesResponse>;
|
|
50
|
+
export declare const ControlDeviceRequest: MessageFns<ControlDeviceRequest>;
|
|
51
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
52
|
+
export type DeepPartial<T> = T extends bigint ? string | number | bigint : T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
53
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
54
|
+
} : Partial<T>;
|
|
55
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
56
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
57
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
58
|
+
} & {
|
|
59
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
60
|
+
};
|
|
61
|
+
export interface MessageFns<T> {
|
|
62
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
63
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
64
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
65
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,328 @@
|
|
|
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_control_menu.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ControlDeviceRequest = exports.GetDevicesResponse = exports.RoomInfo = exports.DeviceInfo = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
+
const device_model_1 = require("./device_model");
|
|
12
|
+
exports.protobufPackage = "hannah.v2";
|
|
13
|
+
function createBaseDeviceInfo() {
|
|
14
|
+
return { id: "", name: "", deviceClass: 0, slots: [], available: false };
|
|
15
|
+
}
|
|
16
|
+
exports.DeviceInfo = {
|
|
17
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
18
|
+
if (message.id !== "") {
|
|
19
|
+
writer.uint32(10).string(message.id);
|
|
20
|
+
}
|
|
21
|
+
if (message.name !== "") {
|
|
22
|
+
writer.uint32(18).string(message.name);
|
|
23
|
+
}
|
|
24
|
+
if (message.deviceClass !== 0) {
|
|
25
|
+
writer.uint32(80).int32(message.deviceClass);
|
|
26
|
+
}
|
|
27
|
+
for (const v of message.slots) {
|
|
28
|
+
device_model_1.Slot.encode(v, writer.uint32(90).fork()).join();
|
|
29
|
+
}
|
|
30
|
+
if (message.available !== false) {
|
|
31
|
+
writer.uint32(96).bool(message.available);
|
|
32
|
+
}
|
|
33
|
+
return writer;
|
|
34
|
+
},
|
|
35
|
+
decode(input, length) {
|
|
36
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
37
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
38
|
+
if (previousRecursionDepth >= 100) {
|
|
39
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
40
|
+
}
|
|
41
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
42
|
+
try {
|
|
43
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
44
|
+
const message = createBaseDeviceInfo();
|
|
45
|
+
while (reader.pos < end) {
|
|
46
|
+
const tag = reader.uint32();
|
|
47
|
+
switch (tag >>> 3) {
|
|
48
|
+
case 1: {
|
|
49
|
+
if (tag !== 10) {
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
message.id = reader.string();
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
case 2: {
|
|
56
|
+
if (tag !== 18) {
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
message.name = reader.string();
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
case 10: {
|
|
63
|
+
if (tag !== 80) {
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
message.deviceClass = reader.int32();
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
case 11: {
|
|
70
|
+
if (tag !== 90) {
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
message.slots.push(device_model_1.Slot.decode(reader, reader.uint32()));
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
case 12: {
|
|
77
|
+
if (tag !== 96) {
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
message.available = reader.bool();
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
reader.skip(tag & 7);
|
|
88
|
+
}
|
|
89
|
+
return message;
|
|
90
|
+
}
|
|
91
|
+
finally {
|
|
92
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
create(base) {
|
|
96
|
+
return exports.DeviceInfo.fromPartial(base ?? {});
|
|
97
|
+
},
|
|
98
|
+
fromPartial(object) {
|
|
99
|
+
const message = createBaseDeviceInfo();
|
|
100
|
+
message.id = object.id ?? "";
|
|
101
|
+
message.name = object.name ?? "";
|
|
102
|
+
message.deviceClass = object.deviceClass ?? 0;
|
|
103
|
+
message.slots = object.slots?.map((e) => device_model_1.Slot.fromPartial(e)) || [];
|
|
104
|
+
message.available = object.available ?? false;
|
|
105
|
+
return message;
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
function createBaseRoomInfo() {
|
|
109
|
+
return { key: "", name: "", devices: [] };
|
|
110
|
+
}
|
|
111
|
+
exports.RoomInfo = {
|
|
112
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
113
|
+
if (message.key !== "") {
|
|
114
|
+
writer.uint32(10).string(message.key);
|
|
115
|
+
}
|
|
116
|
+
if (message.name !== "") {
|
|
117
|
+
writer.uint32(18).string(message.name);
|
|
118
|
+
}
|
|
119
|
+
for (const v of message.devices) {
|
|
120
|
+
exports.DeviceInfo.encode(v, writer.uint32(26).fork()).join();
|
|
121
|
+
}
|
|
122
|
+
return writer;
|
|
123
|
+
},
|
|
124
|
+
decode(input, length) {
|
|
125
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
126
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
127
|
+
if (previousRecursionDepth >= 100) {
|
|
128
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
129
|
+
}
|
|
130
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
131
|
+
try {
|
|
132
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
133
|
+
const message = createBaseRoomInfo();
|
|
134
|
+
while (reader.pos < end) {
|
|
135
|
+
const tag = reader.uint32();
|
|
136
|
+
switch (tag >>> 3) {
|
|
137
|
+
case 1: {
|
|
138
|
+
if (tag !== 10) {
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
message.key = reader.string();
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
case 2: {
|
|
145
|
+
if (tag !== 18) {
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
message.name = reader.string();
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
case 3: {
|
|
152
|
+
if (tag !== 26) {
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
message.devices.push(exports.DeviceInfo.decode(reader, reader.uint32()));
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
reader.skip(tag & 7);
|
|
163
|
+
}
|
|
164
|
+
return message;
|
|
165
|
+
}
|
|
166
|
+
finally {
|
|
167
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
create(base) {
|
|
171
|
+
return exports.RoomInfo.fromPartial(base ?? {});
|
|
172
|
+
},
|
|
173
|
+
fromPartial(object) {
|
|
174
|
+
const message = createBaseRoomInfo();
|
|
175
|
+
message.key = object.key ?? "";
|
|
176
|
+
message.name = object.name ?? "";
|
|
177
|
+
message.devices = object.devices?.map((e) => exports.DeviceInfo.fromPartial(e)) || [];
|
|
178
|
+
return message;
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
function createBaseGetDevicesResponse() {
|
|
182
|
+
return { rooms: [] };
|
|
183
|
+
}
|
|
184
|
+
exports.GetDevicesResponse = {
|
|
185
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
186
|
+
for (const v of message.rooms) {
|
|
187
|
+
exports.RoomInfo.encode(v, writer.uint32(10).fork()).join();
|
|
188
|
+
}
|
|
189
|
+
return writer;
|
|
190
|
+
},
|
|
191
|
+
decode(input, length) {
|
|
192
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
193
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
194
|
+
if (previousRecursionDepth >= 100) {
|
|
195
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
196
|
+
}
|
|
197
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
198
|
+
try {
|
|
199
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
200
|
+
const message = createBaseGetDevicesResponse();
|
|
201
|
+
while (reader.pos < end) {
|
|
202
|
+
const tag = reader.uint32();
|
|
203
|
+
switch (tag >>> 3) {
|
|
204
|
+
case 1: {
|
|
205
|
+
if (tag !== 10) {
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
message.rooms.push(exports.RoomInfo.decode(reader, reader.uint32()));
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
reader.skip(tag & 7);
|
|
216
|
+
}
|
|
217
|
+
return message;
|
|
218
|
+
}
|
|
219
|
+
finally {
|
|
220
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
create(base) {
|
|
224
|
+
return exports.GetDevicesResponse.fromPartial(base ?? {});
|
|
225
|
+
},
|
|
226
|
+
fromPartial(object) {
|
|
227
|
+
const message = createBaseGetDevicesResponse();
|
|
228
|
+
message.rooms = object.rooms?.map((e) => exports.RoomInfo.fromPartial(e)) || [];
|
|
229
|
+
return message;
|
|
230
|
+
},
|
|
231
|
+
};
|
|
232
|
+
function createBaseControlDeviceRequest() {
|
|
233
|
+
return { deviceId: "", slotId: "", sourceService: "", sourceUserId: "", value: undefined };
|
|
234
|
+
}
|
|
235
|
+
exports.ControlDeviceRequest = {
|
|
236
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
237
|
+
if (message.deviceId !== "") {
|
|
238
|
+
writer.uint32(10).string(message.deviceId);
|
|
239
|
+
}
|
|
240
|
+
if (message.slotId !== "") {
|
|
241
|
+
writer.uint32(18).string(message.slotId);
|
|
242
|
+
}
|
|
243
|
+
if (message.sourceService !== "") {
|
|
244
|
+
writer.uint32(34).string(message.sourceService);
|
|
245
|
+
}
|
|
246
|
+
if (message.sourceUserId !== "") {
|
|
247
|
+
writer.uint32(42).string(message.sourceUserId);
|
|
248
|
+
}
|
|
249
|
+
if (message.value !== undefined) {
|
|
250
|
+
device_model_1.SlotValue.encode(message.value, writer.uint32(50).fork()).join();
|
|
251
|
+
}
|
|
252
|
+
return writer;
|
|
253
|
+
},
|
|
254
|
+
decode(input, length) {
|
|
255
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
256
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
257
|
+
if (previousRecursionDepth >= 100) {
|
|
258
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
259
|
+
}
|
|
260
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
261
|
+
try {
|
|
262
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
263
|
+
const message = createBaseControlDeviceRequest();
|
|
264
|
+
while (reader.pos < end) {
|
|
265
|
+
const tag = reader.uint32();
|
|
266
|
+
switch (tag >>> 3) {
|
|
267
|
+
case 1: {
|
|
268
|
+
if (tag !== 10) {
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
message.deviceId = reader.string();
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
case 2: {
|
|
275
|
+
if (tag !== 18) {
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
message.slotId = reader.string();
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
case 4: {
|
|
282
|
+
if (tag !== 34) {
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
message.sourceService = reader.string();
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
case 5: {
|
|
289
|
+
if (tag !== 42) {
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
message.sourceUserId = reader.string();
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
case 6: {
|
|
296
|
+
if (tag !== 50) {
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
message.value = device_model_1.SlotValue.decode(reader, reader.uint32());
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
reader.skip(tag & 7);
|
|
307
|
+
}
|
|
308
|
+
return message;
|
|
309
|
+
}
|
|
310
|
+
finally {
|
|
311
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
create(base) {
|
|
315
|
+
return exports.ControlDeviceRequest.fromPartial(base ?? {});
|
|
316
|
+
},
|
|
317
|
+
fromPartial(object) {
|
|
318
|
+
const message = createBaseControlDeviceRequest();
|
|
319
|
+
message.deviceId = object.deviceId ?? "";
|
|
320
|
+
message.slotId = object.slotId ?? "";
|
|
321
|
+
message.sourceService = object.sourceService ?? "";
|
|
322
|
+
message.sourceUserId = object.sourceUserId ?? "";
|
|
323
|
+
message.value = (object.value !== undefined && object.value !== null)
|
|
324
|
+
? device_model_1.SlotValue.fromPartial(object.value)
|
|
325
|
+
: undefined;
|
|
326
|
+
return message;
|
|
327
|
+
},
|
|
328
|
+
};
|