@m1kad0/hannah-proto 0.5.1 → 0.5.2

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/dist/agent.d.ts CHANGED
@@ -216,6 +216,8 @@ export interface AgentDevice {
216
216
  stateType: StateType;
217
217
  /** only set when state_type is ENUM or COLOR */
218
218
  enumValues: EnumValues | undefined;
219
+ /** derived from ioBroker's common.write */
220
+ writable: boolean;
219
221
  }
220
222
  export interface AgentDevice_RoomNamesEntry {
221
223
  key: string;
package/dist/agent.js CHANGED
@@ -1211,6 +1211,7 @@ function createBaseAgentDevice() {
1211
1211
  roomNames: {},
1212
1212
  stateType: 0,
1213
1213
  enumValues: undefined,
1214
+ writable: false,
1214
1215
  };
1215
1216
  }
1216
1217
  exports.AgentDevice = {
@@ -1245,6 +1246,9 @@ exports.AgentDevice = {
1245
1246
  if (message.enumValues !== undefined) {
1246
1247
  shared_1.EnumValues.encode(message.enumValues, writer.uint32(82).fork()).join();
1247
1248
  }
1249
+ if (message.writable !== false) {
1250
+ writer.uint32(88).bool(message.writable);
1251
+ }
1248
1252
  return writer;
1249
1253
  },
1250
1254
  decode(input, length) {
@@ -1327,6 +1331,13 @@ exports.AgentDevice = {
1327
1331
  message.enumValues = shared_1.EnumValues.decode(reader, reader.uint32());
1328
1332
  continue;
1329
1333
  }
1334
+ case 11: {
1335
+ if (tag !== 88) {
1336
+ break;
1337
+ }
1338
+ message.writable = reader.bool();
1339
+ continue;
1340
+ }
1330
1341
  }
1331
1342
  if ((tag & 7) === 4 || tag === 0) {
1332
1343
  break;
@@ -1359,6 +1370,7 @@ exports.AgentDevice = {
1359
1370
  message.enumValues = (object.enumValues !== undefined && object.enumValues !== null)
1360
1371
  ? shared_1.EnumValues.fromPartial(object.enumValues)
1361
1372
  : undefined;
1373
+ message.writable = object.writable ?? false;
1362
1374
  return message;
1363
1375
  },
1364
1376
  };
@@ -22,6 +22,10 @@ export interface DeviceInfo {
22
22
  stateEnumValues: {
23
23
  [key: string]: EnumValues;
24
24
  };
25
+ /** canon-key -> writable */
26
+ stateWritable: {
27
+ [key: string]: boolean;
28
+ };
25
29
  }
26
30
  export interface DeviceInfo_CurrentEntry {
27
31
  key: string;
@@ -35,6 +39,10 @@ export interface DeviceInfo_StateEnumValuesEntry {
35
39
  key: string;
36
40
  value: EnumValues | undefined;
37
41
  }
42
+ export interface DeviceInfo_StateWritableEntry {
43
+ key: string;
44
+ value: boolean;
45
+ }
38
46
  export interface RoomInfo {
39
47
  /** room_id (lowercase), e.g. "wohnzimmer" */
40
48
  key: string;
@@ -57,6 +65,7 @@ export declare const DeviceInfo: MessageFns<DeviceInfo>;
57
65
  export declare const DeviceInfo_CurrentEntry: MessageFns<DeviceInfo_CurrentEntry>;
58
66
  export declare const DeviceInfo_StateTypesEntry: MessageFns<DeviceInfo_StateTypesEntry>;
59
67
  export declare const DeviceInfo_StateEnumValuesEntry: MessageFns<DeviceInfo_StateEnumValuesEntry>;
68
+ export declare const DeviceInfo_StateWritableEntry: MessageFns<DeviceInfo_StateWritableEntry>;
60
69
  export declare const RoomInfo: MessageFns<RoomInfo>;
61
70
  export declare const GetDevicesResponse: MessageFns<GetDevicesResponse>;
62
71
  export declare const ControlDeviceRequest: MessageFns<ControlDeviceRequest>;
@@ -5,13 +5,22 @@
5
5
  // protoc unknown
6
6
  // source: device_control_menu.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ControlDeviceRequest = exports.GetDevicesResponse = exports.RoomInfo = exports.DeviceInfo_StateEnumValuesEntry = exports.DeviceInfo_StateTypesEntry = exports.DeviceInfo_CurrentEntry = exports.DeviceInfo = exports.protobufPackage = void 0;
8
+ exports.ControlDeviceRequest = exports.GetDevicesResponse = exports.RoomInfo = exports.DeviceInfo_StateWritableEntry = exports.DeviceInfo_StateEnumValuesEntry = exports.DeviceInfo_StateTypesEntry = exports.DeviceInfo_CurrentEntry = exports.DeviceInfo = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
11
  const shared_1 = require("./shared");
12
12
  exports.protobufPackage = "hannah";
13
13
  function createBaseDeviceInfo() {
14
- return { id: "", name: "", category: "", states: [], current: {}, stateTypes: {}, stateEnumValues: {} };
14
+ return {
15
+ id: "",
16
+ name: "",
17
+ category: "",
18
+ states: [],
19
+ current: {},
20
+ stateTypes: {},
21
+ stateEnumValues: {},
22
+ stateWritable: {},
23
+ };
15
24
  }
16
25
  exports.DeviceInfo = {
17
26
  encode(message, writer = new wire_1.BinaryWriter()) {
@@ -36,6 +45,9 @@ exports.DeviceInfo = {
36
45
  globalThis.Object.entries(message.stateEnumValues).forEach(([key, value]) => {
37
46
  exports.DeviceInfo_StateEnumValuesEntry.encode({ key: key, value }, writer.uint32(58).fork()).join();
38
47
  });
48
+ globalThis.Object.entries(message.stateWritable).forEach(([key, value]) => {
49
+ exports.DeviceInfo_StateWritableEntry.encode({ key: key, value }, writer.uint32(66).fork()).join();
50
+ });
39
51
  return writer;
40
52
  },
41
53
  decode(input, length) {
@@ -103,6 +115,16 @@ exports.DeviceInfo = {
103
115
  }
104
116
  continue;
105
117
  }
118
+ case 8: {
119
+ if (tag !== 66) {
120
+ break;
121
+ }
122
+ const entry8 = exports.DeviceInfo_StateWritableEntry.decode(reader, reader.uint32());
123
+ if (entry8.value !== undefined) {
124
+ message.stateWritable[entry8.key] = entry8.value;
125
+ }
126
+ continue;
127
+ }
106
128
  }
107
129
  if ((tag & 7) === 4 || tag === 0) {
108
130
  break;
@@ -139,6 +161,12 @@ exports.DeviceInfo = {
139
161
  }
140
162
  return acc;
141
163
  }, {});
164
+ message.stateWritable = globalThis.Object.entries(object.stateWritable ?? {}).reduce((acc, [key, value]) => {
165
+ if (value !== undefined) {
166
+ acc[key] = globalThis.Boolean(value);
167
+ }
168
+ return acc;
169
+ }, {});
142
170
  return message;
143
171
  },
144
172
  };
@@ -300,6 +328,58 @@ exports.DeviceInfo_StateEnumValuesEntry = {
300
328
  return message;
301
329
  },
302
330
  };
331
+ function createBaseDeviceInfo_StateWritableEntry() {
332
+ return { key: "", value: false };
333
+ }
334
+ exports.DeviceInfo_StateWritableEntry = {
335
+ encode(message, writer = new wire_1.BinaryWriter()) {
336
+ if (message.key !== "") {
337
+ writer.uint32(10).string(message.key);
338
+ }
339
+ if (message.value !== false) {
340
+ writer.uint32(16).bool(message.value);
341
+ }
342
+ return writer;
343
+ },
344
+ decode(input, length) {
345
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
346
+ const end = length === undefined ? reader.len : reader.pos + length;
347
+ const message = createBaseDeviceInfo_StateWritableEntry();
348
+ while (reader.pos < end) {
349
+ const tag = reader.uint32();
350
+ switch (tag >>> 3) {
351
+ case 1: {
352
+ if (tag !== 10) {
353
+ break;
354
+ }
355
+ message.key = reader.string();
356
+ continue;
357
+ }
358
+ case 2: {
359
+ if (tag !== 16) {
360
+ break;
361
+ }
362
+ message.value = reader.bool();
363
+ continue;
364
+ }
365
+ }
366
+ if ((tag & 7) === 4 || tag === 0) {
367
+ break;
368
+ }
369
+ reader.skip(tag & 7);
370
+ }
371
+ return message;
372
+ },
373
+ create(base) {
374
+ return exports.DeviceInfo_StateWritableEntry.fromPartial(base ?? {});
375
+ },
376
+ fromPartial(object) {
377
+ const message = createBaseDeviceInfo_StateWritableEntry();
378
+ message.key = object.key ?? "";
379
+ message.value = object.value ?? false;
380
+ return message;
381
+ },
382
+ };
303
383
  function createBaseRoomInfo() {
304
384
  return { key: "", name: "", devices: [] };
305
385
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m1kad0/hannah-proto",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Generated TypeScript gRPC-js client stubs for the Hannah voice assistant proto schema",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",