@m1kad0/hannah-proto 4.0.0 → 4.2.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/dist/agent.d.ts CHANGED
@@ -10,6 +10,24 @@ export declare enum ResidentType {
10
10
  PET = 3,
11
11
  UNRECOGNIZED = -1
12
12
  }
13
+ /**
14
+ * Which single presence aspect to set. The residents adapter's presence.{away,home,night}
15
+ * datapoints guard their own cross-consistency (e.g. setting "away" true automatically
16
+ * flips "home" false) — Hannah only needs to name the aspect it actually has an opinion
17
+ * about, instead of writing the whole combined presence.state value (hannah#309, root
18
+ * cause of hannah#299: two independent Hannah-side decisions, home/away presence fusion
19
+ * and an explicit asleep/awake trigger, collapsed onto one write and could clobber each
20
+ * other's information). SET_AWAKE has no direct presence.state equivalent — it only
21
+ * clears "night" and leaves "home" untouched, regardless of its current value.
22
+ */
23
+ export declare enum ResidentPresenceAction {
24
+ RESIDENT_PRESENCE_ACTION_UNSPECIFIED = 0,
25
+ AWAY = 1,
26
+ HOME = 2,
27
+ ASLEEP = 3,
28
+ AWAKE = 4,
29
+ UNRECOGNIZED = -1
30
+ }
13
31
  /** Sent by the HannahAgent ioBroker adapter over the AgentConnect stream. */
14
32
  export interface AgentMessage {
15
33
  /** any ioBroker state changed */
@@ -141,9 +159,23 @@ export interface AgentWatchMore {
141
159
  export interface AgentSetResident {
142
160
  /** e.g. "leonie", "hannah" */
143
161
  residentId: string;
144
- /** residents adapter presence value (0=absent, 1=home, …) */
162
+ /**
163
+ * Legacy absolute presence value (0=absent, 1=home, 2=night) — writes the combined
164
+ * presence.state, which cross-clobbers whichever of home/away/night Hannah didn't
165
+ * intend to change. Superseded by `action`; kept only for adapters older than
166
+ * compat_version 2, which don't understand `action` yet and ignore it entirely.
167
+ * Senders should populate both until those adapters are no longer in use.
168
+ *
169
+ * @deprecated
170
+ */
145
171
  presenceState: number;
146
172
  type: ResidentType;
173
+ /**
174
+ * Preferred over `presence_state`: sets only the single presence.{away,home,night}
175
+ * flag this action corresponds to, letting the residents adapter's own consistency
176
+ * guard handle the rest.
177
+ */
178
+ action: ResidentPresenceAction;
147
179
  }
148
180
  /**
149
181
  * Hannah instructs the adapter to set a resident's mood — separate command from
package/dist/agent.js CHANGED
@@ -5,7 +5,7 @@
5
5
  // protoc unknown
6
6
  // source: hannah/agent.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.AgentSensorUpdate = exports.AgentBleUpdate = exports.AgentResidentAnswered = exports.AgentAskResident = exports.AgentResidentSnapshot = exports.AgentResident = exports.AgentRoomSnapshot = exports.AgentRoom_DisplayNamesEntry = exports.AgentRoom = exports.AgentDeviceSnapshot = exports.AgentDevice_RoomNamesEntry = exports.AgentDevice = exports.AgentStateValue = exports.AgentNotification = exports.AgentTextAnswer = exports.AgentSatelliteDeleted = exports.AgentSatelliteUpdate = exports.AgentSetResidentMood = exports.AgentSetResident = exports.AgentWatchMore = exports.AgentSetState = exports.AgentFirmwareEvent = exports.AgentCommand = exports.AgentTextCommand = exports.AgentStateUpdate = exports.CaptureControl = exports.AgentSatelliteControl = exports.AgentMessage = exports.ResidentType = exports.protobufPackage = void 0;
8
+ exports.AgentSensorUpdate = exports.AgentBleUpdate = exports.AgentResidentAnswered = exports.AgentAskResident = exports.AgentResidentSnapshot = exports.AgentResident = exports.AgentRoomSnapshot = exports.AgentRoom_DisplayNamesEntry = exports.AgentRoom = exports.AgentDeviceSnapshot = exports.AgentDevice_RoomNamesEntry = exports.AgentDevice = exports.AgentStateValue = exports.AgentNotification = exports.AgentTextAnswer = exports.AgentSatelliteDeleted = exports.AgentSatelliteUpdate = exports.AgentSetResidentMood = exports.AgentSetResident = exports.AgentWatchMore = exports.AgentSetState = exports.AgentFirmwareEvent = exports.AgentCommand = exports.AgentTextCommand = exports.AgentStateUpdate = exports.CaptureControl = exports.AgentSatelliteControl = exports.AgentMessage = exports.ResidentPresenceAction = exports.ResidentType = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
11
  const shared_1 = require("./shared");
@@ -20,6 +20,25 @@ var ResidentType;
20
20
  ResidentType[ResidentType["PET"] = 3] = "PET";
21
21
  ResidentType[ResidentType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
22
22
  })(ResidentType || (exports.ResidentType = ResidentType = {}));
23
+ /**
24
+ * Which single presence aspect to set. The residents adapter's presence.{away,home,night}
25
+ * datapoints guard their own cross-consistency (e.g. setting "away" true automatically
26
+ * flips "home" false) — Hannah only needs to name the aspect it actually has an opinion
27
+ * about, instead of writing the whole combined presence.state value (hannah#309, root
28
+ * cause of hannah#299: two independent Hannah-side decisions, home/away presence fusion
29
+ * and an explicit asleep/awake trigger, collapsed onto one write and could clobber each
30
+ * other's information). SET_AWAKE has no direct presence.state equivalent — it only
31
+ * clears "night" and leaves "home" untouched, regardless of its current value.
32
+ */
33
+ var ResidentPresenceAction;
34
+ (function (ResidentPresenceAction) {
35
+ ResidentPresenceAction[ResidentPresenceAction["RESIDENT_PRESENCE_ACTION_UNSPECIFIED"] = 0] = "RESIDENT_PRESENCE_ACTION_UNSPECIFIED";
36
+ ResidentPresenceAction[ResidentPresenceAction["AWAY"] = 1] = "AWAY";
37
+ ResidentPresenceAction[ResidentPresenceAction["HOME"] = 2] = "HOME";
38
+ ResidentPresenceAction[ResidentPresenceAction["ASLEEP"] = 3] = "ASLEEP";
39
+ ResidentPresenceAction[ResidentPresenceAction["AWAKE"] = 4] = "AWAKE";
40
+ ResidentPresenceAction[ResidentPresenceAction["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
41
+ })(ResidentPresenceAction || (exports.ResidentPresenceAction = ResidentPresenceAction = {}));
23
42
  function createBaseAgentMessage() {
24
43
  return {
25
44
  stateUpdate: undefined,
@@ -933,7 +952,7 @@ exports.AgentWatchMore = {
933
952
  },
934
953
  };
935
954
  function createBaseAgentSetResident() {
936
- return { residentId: "", presenceState: 0, type: 0 };
955
+ return { residentId: "", presenceState: 0, type: 0, action: 0 };
937
956
  }
938
957
  exports.AgentSetResident = {
939
958
  encode(message, writer = new wire_1.BinaryWriter()) {
@@ -946,6 +965,9 @@ exports.AgentSetResident = {
946
965
  if (message.type !== 0) {
947
966
  writer.uint32(24).int32(message.type);
948
967
  }
968
+ if (message.action !== 0) {
969
+ writer.uint32(32).int32(message.action);
970
+ }
949
971
  return writer;
950
972
  },
951
973
  decode(input, length) {
@@ -982,6 +1004,13 @@ exports.AgentSetResident = {
982
1004
  message.type = reader.int32();
983
1005
  continue;
984
1006
  }
1007
+ case 4: {
1008
+ if (tag !== 32) {
1009
+ break;
1010
+ }
1011
+ message.action = reader.int32();
1012
+ continue;
1013
+ }
985
1014
  }
986
1015
  if ((tag & 7) === 4 || tag === 0) {
987
1016
  break;
@@ -1002,6 +1031,7 @@ exports.AgentSetResident = {
1002
1031
  message.residentId = object.residentId ?? "";
1003
1032
  message.presenceState = object.presenceState ?? 0;
1004
1033
  message.type = object.type ?? 0;
1034
+ message.action = object.action ?? 0;
1005
1035
  return message;
1006
1036
  },
1007
1037
  };
@@ -48,6 +48,10 @@ exports.REQUIRED_COMPAT_VERSIONS = {
48
48
  "CreateBleTag": 1,
49
49
  "UpdateBleTag": 1,
50
50
  "DeleteBleTag": 1,
51
+ "GetPresenceSources": 1,
52
+ "CreatePresenceSource": 1,
53
+ "UpdatePresenceSource": 1,
54
+ "DeletePresenceSource": 1,
51
55
  "GetCars": 1,
52
56
  "CreateCar": 1,
53
57
  "UpdateCar": 1,
package/dist/control.d.ts CHANGED
@@ -244,6 +244,47 @@ export interface UpdateBleTagRequest {
244
244
  export interface DeleteBleTagRequest {
245
245
  id: number;
246
246
  }
247
+ export interface PresenceSource {
248
+ id: number;
249
+ userId: number;
250
+ /** "iobroker_state" | "ble_tag" */
251
+ sourceType: string;
252
+ /** state_id (iobroker_state) bzw. BleTag-Referenz (ble_tag) */
253
+ reference: string;
254
+ /** 0.0-1.0 */
255
+ homeConfidence: number;
256
+ /** 0.0-1.0 */
257
+ awayConfidence: number;
258
+ enabled: boolean;
259
+ }
260
+ export interface GetPresenceSourcesResponse {
261
+ presenceSources: PresenceSource[];
262
+ }
263
+ export interface CreatePresenceSourceRequest {
264
+ userId: number;
265
+ sourceType: string;
266
+ reference: string;
267
+ homeConfidence: number;
268
+ awayConfidence: number;
269
+ enabled: boolean;
270
+ }
271
+ export interface CreatePresenceSourceResponse {
272
+ ok: boolean;
273
+ id: number;
274
+ message: string;
275
+ }
276
+ export interface UpdatePresenceSourceRequest {
277
+ id: number;
278
+ userId: number;
279
+ sourceType: string;
280
+ reference: string;
281
+ homeConfidence: number;
282
+ awayConfidence: number;
283
+ enabled: boolean;
284
+ }
285
+ export interface DeletePresenceSourceRequest {
286
+ id: number;
287
+ }
247
288
  export interface Car {
248
289
  id: number;
249
290
  topicPrefix: string;
@@ -311,6 +352,12 @@ export declare const CreateBleTagRequest: MessageFns<CreateBleTagRequest>;
311
352
  export declare const CreateBleTagResponse: MessageFns<CreateBleTagResponse>;
312
353
  export declare const UpdateBleTagRequest: MessageFns<UpdateBleTagRequest>;
313
354
  export declare const DeleteBleTagRequest: MessageFns<DeleteBleTagRequest>;
355
+ export declare const PresenceSource: MessageFns<PresenceSource>;
356
+ export declare const GetPresenceSourcesResponse: MessageFns<GetPresenceSourcesResponse>;
357
+ export declare const CreatePresenceSourceRequest: MessageFns<CreatePresenceSourceRequest>;
358
+ export declare const CreatePresenceSourceResponse: MessageFns<CreatePresenceSourceResponse>;
359
+ export declare const UpdatePresenceSourceRequest: MessageFns<UpdatePresenceSourceRequest>;
360
+ export declare const DeletePresenceSourceRequest: MessageFns<DeletePresenceSourceRequest>;
314
361
  export declare const Car: MessageFns<Car>;
315
362
  export declare const GetCarsResponse: MessageFns<GetCarsResponse>;
316
363
  export declare const CreateCarRequest: MessageFns<CreateCarRequest>;
package/dist/control.js CHANGED
@@ -5,7 +5,7 @@
5
5
  // protoc unknown
6
6
  // source: hannah/control.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.DeleteCarRequest = exports.UpdateCarRequest = exports.CreateCarResponse = exports.CreateCarRequest = exports.GetCarsResponse = exports.Car = 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;
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
11
  exports.protobufPackage = "hannah";
@@ -2886,6 +2886,521 @@ exports.DeleteBleTagRequest = {
2886
2886
  return message;
2887
2887
  },
2888
2888
  };
2889
+ function createBasePresenceSource() {
2890
+ return { id: 0, userId: 0, sourceType: "", reference: "", homeConfidence: 0, awayConfidence: 0, enabled: false };
2891
+ }
2892
+ exports.PresenceSource = {
2893
+ encode(message, writer = new wire_1.BinaryWriter()) {
2894
+ if (message.id !== 0) {
2895
+ writer.uint32(8).int32(message.id);
2896
+ }
2897
+ if (message.userId !== 0) {
2898
+ writer.uint32(16).int32(message.userId);
2899
+ }
2900
+ if (message.sourceType !== "") {
2901
+ writer.uint32(26).string(message.sourceType);
2902
+ }
2903
+ if (message.reference !== "") {
2904
+ writer.uint32(34).string(message.reference);
2905
+ }
2906
+ if (message.homeConfidence !== 0) {
2907
+ writer.uint32(45).float(message.homeConfidence);
2908
+ }
2909
+ if (message.awayConfidence !== 0) {
2910
+ writer.uint32(53).float(message.awayConfidence);
2911
+ }
2912
+ if (message.enabled !== false) {
2913
+ writer.uint32(56).bool(message.enabled);
2914
+ }
2915
+ return writer;
2916
+ },
2917
+ decode(input, length) {
2918
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2919
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2920
+ if (previousRecursionDepth >= 100) {
2921
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2922
+ }
2923
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2924
+ try {
2925
+ const end = length === undefined ? reader.len : reader.pos + length;
2926
+ const message = createBasePresenceSource();
2927
+ while (reader.pos < end) {
2928
+ const tag = reader.uint32();
2929
+ switch (tag >>> 3) {
2930
+ case 1: {
2931
+ if (tag !== 8) {
2932
+ break;
2933
+ }
2934
+ message.id = reader.int32();
2935
+ continue;
2936
+ }
2937
+ case 2: {
2938
+ if (tag !== 16) {
2939
+ break;
2940
+ }
2941
+ message.userId = reader.int32();
2942
+ continue;
2943
+ }
2944
+ case 3: {
2945
+ if (tag !== 26) {
2946
+ break;
2947
+ }
2948
+ message.sourceType = reader.string();
2949
+ continue;
2950
+ }
2951
+ case 4: {
2952
+ if (tag !== 34) {
2953
+ break;
2954
+ }
2955
+ message.reference = reader.string();
2956
+ continue;
2957
+ }
2958
+ case 5: {
2959
+ if (tag !== 45) {
2960
+ break;
2961
+ }
2962
+ message.homeConfidence = reader.float();
2963
+ continue;
2964
+ }
2965
+ case 6: {
2966
+ if (tag !== 53) {
2967
+ break;
2968
+ }
2969
+ message.awayConfidence = reader.float();
2970
+ continue;
2971
+ }
2972
+ case 7: {
2973
+ if (tag !== 56) {
2974
+ break;
2975
+ }
2976
+ message.enabled = reader.bool();
2977
+ continue;
2978
+ }
2979
+ }
2980
+ if ((tag & 7) === 4 || tag === 0) {
2981
+ break;
2982
+ }
2983
+ reader.skip(tag & 7);
2984
+ }
2985
+ return message;
2986
+ }
2987
+ finally {
2988
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2989
+ }
2990
+ },
2991
+ create(base) {
2992
+ return exports.PresenceSource.fromPartial(base ?? {});
2993
+ },
2994
+ fromPartial(object) {
2995
+ const message = createBasePresenceSource();
2996
+ message.id = object.id ?? 0;
2997
+ message.userId = object.userId ?? 0;
2998
+ message.sourceType = object.sourceType ?? "";
2999
+ message.reference = object.reference ?? "";
3000
+ message.homeConfidence = object.homeConfidence ?? 0;
3001
+ message.awayConfidence = object.awayConfidence ?? 0;
3002
+ message.enabled = object.enabled ?? false;
3003
+ return message;
3004
+ },
3005
+ };
3006
+ function createBaseGetPresenceSourcesResponse() {
3007
+ return { presenceSources: [] };
3008
+ }
3009
+ exports.GetPresenceSourcesResponse = {
3010
+ encode(message, writer = new wire_1.BinaryWriter()) {
3011
+ for (const v of message.presenceSources) {
3012
+ exports.PresenceSource.encode(v, writer.uint32(10).fork()).join();
3013
+ }
3014
+ return writer;
3015
+ },
3016
+ decode(input, length) {
3017
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3018
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3019
+ if (previousRecursionDepth >= 100) {
3020
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3021
+ }
3022
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3023
+ try {
3024
+ const end = length === undefined ? reader.len : reader.pos + length;
3025
+ const message = createBaseGetPresenceSourcesResponse();
3026
+ while (reader.pos < end) {
3027
+ const tag = reader.uint32();
3028
+ switch (tag >>> 3) {
3029
+ case 1: {
3030
+ if (tag !== 10) {
3031
+ break;
3032
+ }
3033
+ message.presenceSources.push(exports.PresenceSource.decode(reader, reader.uint32()));
3034
+ continue;
3035
+ }
3036
+ }
3037
+ if ((tag & 7) === 4 || tag === 0) {
3038
+ break;
3039
+ }
3040
+ reader.skip(tag & 7);
3041
+ }
3042
+ return message;
3043
+ }
3044
+ finally {
3045
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3046
+ }
3047
+ },
3048
+ create(base) {
3049
+ return exports.GetPresenceSourcesResponse.fromPartial(base ?? {});
3050
+ },
3051
+ fromPartial(object) {
3052
+ const message = createBaseGetPresenceSourcesResponse();
3053
+ message.presenceSources = object.presenceSources?.map((e) => exports.PresenceSource.fromPartial(e)) || [];
3054
+ return message;
3055
+ },
3056
+ };
3057
+ function createBaseCreatePresenceSourceRequest() {
3058
+ return { userId: 0, sourceType: "", reference: "", homeConfidence: 0, awayConfidence: 0, enabled: false };
3059
+ }
3060
+ exports.CreatePresenceSourceRequest = {
3061
+ encode(message, writer = new wire_1.BinaryWriter()) {
3062
+ if (message.userId !== 0) {
3063
+ writer.uint32(8).int32(message.userId);
3064
+ }
3065
+ if (message.sourceType !== "") {
3066
+ writer.uint32(18).string(message.sourceType);
3067
+ }
3068
+ if (message.reference !== "") {
3069
+ writer.uint32(26).string(message.reference);
3070
+ }
3071
+ if (message.homeConfidence !== 0) {
3072
+ writer.uint32(37).float(message.homeConfidence);
3073
+ }
3074
+ if (message.awayConfidence !== 0) {
3075
+ writer.uint32(45).float(message.awayConfidence);
3076
+ }
3077
+ if (message.enabled !== false) {
3078
+ writer.uint32(48).bool(message.enabled);
3079
+ }
3080
+ return writer;
3081
+ },
3082
+ decode(input, length) {
3083
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3084
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3085
+ if (previousRecursionDepth >= 100) {
3086
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3087
+ }
3088
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3089
+ try {
3090
+ const end = length === undefined ? reader.len : reader.pos + length;
3091
+ const message = createBaseCreatePresenceSourceRequest();
3092
+ while (reader.pos < end) {
3093
+ const tag = reader.uint32();
3094
+ switch (tag >>> 3) {
3095
+ case 1: {
3096
+ if (tag !== 8) {
3097
+ break;
3098
+ }
3099
+ message.userId = reader.int32();
3100
+ continue;
3101
+ }
3102
+ case 2: {
3103
+ if (tag !== 18) {
3104
+ break;
3105
+ }
3106
+ message.sourceType = reader.string();
3107
+ continue;
3108
+ }
3109
+ case 3: {
3110
+ if (tag !== 26) {
3111
+ break;
3112
+ }
3113
+ message.reference = reader.string();
3114
+ continue;
3115
+ }
3116
+ case 4: {
3117
+ if (tag !== 37) {
3118
+ break;
3119
+ }
3120
+ message.homeConfidence = reader.float();
3121
+ continue;
3122
+ }
3123
+ case 5: {
3124
+ if (tag !== 45) {
3125
+ break;
3126
+ }
3127
+ message.awayConfidence = reader.float();
3128
+ continue;
3129
+ }
3130
+ case 6: {
3131
+ if (tag !== 48) {
3132
+ break;
3133
+ }
3134
+ message.enabled = reader.bool();
3135
+ continue;
3136
+ }
3137
+ }
3138
+ if ((tag & 7) === 4 || tag === 0) {
3139
+ break;
3140
+ }
3141
+ reader.skip(tag & 7);
3142
+ }
3143
+ return message;
3144
+ }
3145
+ finally {
3146
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3147
+ }
3148
+ },
3149
+ create(base) {
3150
+ return exports.CreatePresenceSourceRequest.fromPartial(base ?? {});
3151
+ },
3152
+ fromPartial(object) {
3153
+ const message = createBaseCreatePresenceSourceRequest();
3154
+ message.userId = object.userId ?? 0;
3155
+ message.sourceType = object.sourceType ?? "";
3156
+ message.reference = object.reference ?? "";
3157
+ message.homeConfidence = object.homeConfidence ?? 0;
3158
+ message.awayConfidence = object.awayConfidence ?? 0;
3159
+ message.enabled = object.enabled ?? false;
3160
+ return message;
3161
+ },
3162
+ };
3163
+ function createBaseCreatePresenceSourceResponse() {
3164
+ return { ok: false, id: 0, message: "" };
3165
+ }
3166
+ exports.CreatePresenceSourceResponse = {
3167
+ encode(message, writer = new wire_1.BinaryWriter()) {
3168
+ if (message.ok !== false) {
3169
+ writer.uint32(8).bool(message.ok);
3170
+ }
3171
+ if (message.id !== 0) {
3172
+ writer.uint32(16).int32(message.id);
3173
+ }
3174
+ if (message.message !== "") {
3175
+ writer.uint32(26).string(message.message);
3176
+ }
3177
+ return writer;
3178
+ },
3179
+ decode(input, length) {
3180
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3181
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3182
+ if (previousRecursionDepth >= 100) {
3183
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3184
+ }
3185
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3186
+ try {
3187
+ const end = length === undefined ? reader.len : reader.pos + length;
3188
+ const message = createBaseCreatePresenceSourceResponse();
3189
+ while (reader.pos < end) {
3190
+ const tag = reader.uint32();
3191
+ switch (tag >>> 3) {
3192
+ case 1: {
3193
+ if (tag !== 8) {
3194
+ break;
3195
+ }
3196
+ message.ok = reader.bool();
3197
+ continue;
3198
+ }
3199
+ case 2: {
3200
+ if (tag !== 16) {
3201
+ break;
3202
+ }
3203
+ message.id = reader.int32();
3204
+ continue;
3205
+ }
3206
+ case 3: {
3207
+ if (tag !== 26) {
3208
+ break;
3209
+ }
3210
+ message.message = reader.string();
3211
+ continue;
3212
+ }
3213
+ }
3214
+ if ((tag & 7) === 4 || tag === 0) {
3215
+ break;
3216
+ }
3217
+ reader.skip(tag & 7);
3218
+ }
3219
+ return message;
3220
+ }
3221
+ finally {
3222
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3223
+ }
3224
+ },
3225
+ create(base) {
3226
+ return exports.CreatePresenceSourceResponse.fromPartial(base ?? {});
3227
+ },
3228
+ fromPartial(object) {
3229
+ const message = createBaseCreatePresenceSourceResponse();
3230
+ message.ok = object.ok ?? false;
3231
+ message.id = object.id ?? 0;
3232
+ message.message = object.message ?? "";
3233
+ return message;
3234
+ },
3235
+ };
3236
+ function createBaseUpdatePresenceSourceRequest() {
3237
+ return { id: 0, userId: 0, sourceType: "", reference: "", homeConfidence: 0, awayConfidence: 0, enabled: false };
3238
+ }
3239
+ exports.UpdatePresenceSourceRequest = {
3240
+ encode(message, writer = new wire_1.BinaryWriter()) {
3241
+ if (message.id !== 0) {
3242
+ writer.uint32(8).int32(message.id);
3243
+ }
3244
+ if (message.userId !== 0) {
3245
+ writer.uint32(16).int32(message.userId);
3246
+ }
3247
+ if (message.sourceType !== "") {
3248
+ writer.uint32(26).string(message.sourceType);
3249
+ }
3250
+ if (message.reference !== "") {
3251
+ writer.uint32(34).string(message.reference);
3252
+ }
3253
+ if (message.homeConfidence !== 0) {
3254
+ writer.uint32(45).float(message.homeConfidence);
3255
+ }
3256
+ if (message.awayConfidence !== 0) {
3257
+ writer.uint32(53).float(message.awayConfidence);
3258
+ }
3259
+ if (message.enabled !== false) {
3260
+ writer.uint32(56).bool(message.enabled);
3261
+ }
3262
+ return writer;
3263
+ },
3264
+ decode(input, length) {
3265
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3266
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3267
+ if (previousRecursionDepth >= 100) {
3268
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3269
+ }
3270
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3271
+ try {
3272
+ const end = length === undefined ? reader.len : reader.pos + length;
3273
+ const message = createBaseUpdatePresenceSourceRequest();
3274
+ while (reader.pos < end) {
3275
+ const tag = reader.uint32();
3276
+ switch (tag >>> 3) {
3277
+ case 1: {
3278
+ if (tag !== 8) {
3279
+ break;
3280
+ }
3281
+ message.id = reader.int32();
3282
+ continue;
3283
+ }
3284
+ case 2: {
3285
+ if (tag !== 16) {
3286
+ break;
3287
+ }
3288
+ message.userId = reader.int32();
3289
+ continue;
3290
+ }
3291
+ case 3: {
3292
+ if (tag !== 26) {
3293
+ break;
3294
+ }
3295
+ message.sourceType = reader.string();
3296
+ continue;
3297
+ }
3298
+ case 4: {
3299
+ if (tag !== 34) {
3300
+ break;
3301
+ }
3302
+ message.reference = reader.string();
3303
+ continue;
3304
+ }
3305
+ case 5: {
3306
+ if (tag !== 45) {
3307
+ break;
3308
+ }
3309
+ message.homeConfidence = reader.float();
3310
+ continue;
3311
+ }
3312
+ case 6: {
3313
+ if (tag !== 53) {
3314
+ break;
3315
+ }
3316
+ message.awayConfidence = reader.float();
3317
+ continue;
3318
+ }
3319
+ case 7: {
3320
+ if (tag !== 56) {
3321
+ break;
3322
+ }
3323
+ message.enabled = reader.bool();
3324
+ continue;
3325
+ }
3326
+ }
3327
+ if ((tag & 7) === 4 || tag === 0) {
3328
+ break;
3329
+ }
3330
+ reader.skip(tag & 7);
3331
+ }
3332
+ return message;
3333
+ }
3334
+ finally {
3335
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3336
+ }
3337
+ },
3338
+ create(base) {
3339
+ return exports.UpdatePresenceSourceRequest.fromPartial(base ?? {});
3340
+ },
3341
+ fromPartial(object) {
3342
+ const message = createBaseUpdatePresenceSourceRequest();
3343
+ message.id = object.id ?? 0;
3344
+ message.userId = object.userId ?? 0;
3345
+ message.sourceType = object.sourceType ?? "";
3346
+ message.reference = object.reference ?? "";
3347
+ message.homeConfidence = object.homeConfidence ?? 0;
3348
+ message.awayConfidence = object.awayConfidence ?? 0;
3349
+ message.enabled = object.enabled ?? false;
3350
+ return message;
3351
+ },
3352
+ };
3353
+ function createBaseDeletePresenceSourceRequest() {
3354
+ return { id: 0 };
3355
+ }
3356
+ exports.DeletePresenceSourceRequest = {
3357
+ encode(message, writer = new wire_1.BinaryWriter()) {
3358
+ if (message.id !== 0) {
3359
+ writer.uint32(8).int32(message.id);
3360
+ }
3361
+ return writer;
3362
+ },
3363
+ decode(input, length) {
3364
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3365
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3366
+ if (previousRecursionDepth >= 100) {
3367
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3368
+ }
3369
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3370
+ try {
3371
+ const end = length === undefined ? reader.len : reader.pos + length;
3372
+ const message = createBaseDeletePresenceSourceRequest();
3373
+ while (reader.pos < end) {
3374
+ const tag = reader.uint32();
3375
+ switch (tag >>> 3) {
3376
+ case 1: {
3377
+ if (tag !== 8) {
3378
+ break;
3379
+ }
3380
+ message.id = reader.int32();
3381
+ continue;
3382
+ }
3383
+ }
3384
+ if ((tag & 7) === 4 || tag === 0) {
3385
+ break;
3386
+ }
3387
+ reader.skip(tag & 7);
3388
+ }
3389
+ return message;
3390
+ }
3391
+ finally {
3392
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3393
+ }
3394
+ },
3395
+ create(base) {
3396
+ return exports.DeletePresenceSourceRequest.fromPartial(base ?? {});
3397
+ },
3398
+ fromPartial(object) {
3399
+ const message = createBaseDeletePresenceSourceRequest();
3400
+ message.id = object.id ?? 0;
3401
+ return message;
3402
+ },
3403
+ };
2889
3404
  function createBaseCar() {
2890
3405
  return { id: 0, topicPrefix: "", homeAddress: "", ownerUserIds: [], name: "" };
2891
3406
  }
Binary file
package/dist/hannah.d.ts CHANGED
@@ -3,7 +3,7 @@ import { ActivityAudioChunk, ListActivityLogRequest, ListActivityLogResponse, St
3
3
  import { AgentCommand, AgentMessage, AgentNotification } from "./agent";
4
4
  import { AutomationCommand, AutomationMessage } from "./automation";
5
5
  import { CarStateResponse, GetAllCarStatesResponse } from "./car_state";
6
- import { AnnounceRequest, CreateAlarmRequest, CreateAlarmResponse, CreateBleTagRequest, CreateBleTagResponse, CreateCarRequest, CreateCarResponse, CreateGroupRequest, CreateTriggerRequest, DeleteAlarmRequest, DeleteBleTagRequest, DeleteCarRequest, DeleteGroupRequest, DeleteTriggerRequest, GetAlarmsResponse, GetBleTagsResponse, GetCarsResponse, GetGroupsResponse, GetRoomsResponse, GetSettingsResponse, GetTriggersResponse, SetGroupSatellitesRequest, SubmitTextRequest, SubmitTextResponse, SubmitVoiceRequest, SubmitVoiceResponse, UpdateAlarmRequest, UpdateBleTagRequest, UpdateCarRequest, UpdateConfigRequest, UpdateGroupRequest, UpdateTriggerRequest } from "./control";
6
+ import { AnnounceRequest, CreateAlarmRequest, CreateAlarmResponse, CreateBleTagRequest, CreateBleTagResponse, CreateCarRequest, CreateCarResponse, CreateGroupRequest, CreatePresenceSourceRequest, CreatePresenceSourceResponse, CreateTriggerRequest, DeleteAlarmRequest, DeleteBleTagRequest, DeleteCarRequest, DeleteGroupRequest, DeletePresenceSourceRequest, DeleteTriggerRequest, GetAlarmsResponse, GetBleTagsResponse, GetCarsResponse, GetGroupsResponse, GetPresenceSourcesResponse, GetRoomsResponse, GetSettingsResponse, GetTriggersResponse, SetGroupSatellitesRequest, SubmitTextRequest, SubmitTextResponse, SubmitVoiceRequest, SubmitVoiceResponse, UpdateAlarmRequest, UpdateBleTagRequest, UpdateCarRequest, UpdateConfigRequest, UpdateGroupRequest, UpdatePresenceSourceRequest, UpdateTriggerRequest } from "./control";
7
7
  import { ControlDeviceRequest, GetDevicesResponse } from "./device_control_menu";
8
8
  import { EventFilter, HannahEvent, TriggerFirmwareUpdateRequest, TriggerSatelliteRestartRequest } from "./event_stream";
9
9
  import { CreateMessageRequest, DeleteMessageRequest, ListMessagesRequest, ListMessagesResponse } from "./messages";
@@ -455,6 +455,43 @@ export declare const HannahServiceService: {
455
455
  readonly responseSerialize: (value: StatusResponse) => Buffer;
456
456
  readonly responseDeserialize: (value: Buffer) => StatusResponse;
457
457
  };
458
+ /** --- Presence Sources (Admin-UI, hannah#294 — presence fusion) --- */
459
+ readonly getPresenceSources: {
460
+ readonly path: "/hannah.HannahService/GetPresenceSources";
461
+ readonly requestStream: false;
462
+ readonly responseStream: false;
463
+ readonly requestSerialize: (value: Empty) => Buffer;
464
+ readonly requestDeserialize: (value: Buffer) => Empty;
465
+ readonly responseSerialize: (value: GetPresenceSourcesResponse) => Buffer;
466
+ readonly responseDeserialize: (value: Buffer) => GetPresenceSourcesResponse;
467
+ };
468
+ readonly createPresenceSource: {
469
+ readonly path: "/hannah.HannahService/CreatePresenceSource";
470
+ readonly requestStream: false;
471
+ readonly responseStream: false;
472
+ readonly requestSerialize: (value: CreatePresenceSourceRequest) => Buffer;
473
+ readonly requestDeserialize: (value: Buffer) => CreatePresenceSourceRequest;
474
+ readonly responseSerialize: (value: CreatePresenceSourceResponse) => Buffer;
475
+ readonly responseDeserialize: (value: Buffer) => CreatePresenceSourceResponse;
476
+ };
477
+ readonly updatePresenceSource: {
478
+ readonly path: "/hannah.HannahService/UpdatePresenceSource";
479
+ readonly requestStream: false;
480
+ readonly responseStream: false;
481
+ readonly requestSerialize: (value: UpdatePresenceSourceRequest) => Buffer;
482
+ readonly requestDeserialize: (value: Buffer) => UpdatePresenceSourceRequest;
483
+ readonly responseSerialize: (value: StatusResponse) => Buffer;
484
+ readonly responseDeserialize: (value: Buffer) => StatusResponse;
485
+ };
486
+ readonly deletePresenceSource: {
487
+ readonly path: "/hannah.HannahService/DeletePresenceSource";
488
+ readonly requestStream: false;
489
+ readonly responseStream: false;
490
+ readonly requestSerialize: (value: DeletePresenceSourceRequest) => Buffer;
491
+ readonly requestDeserialize: (value: Buffer) => DeletePresenceSourceRequest;
492
+ readonly responseSerialize: (value: StatusResponse) => Buffer;
493
+ readonly responseDeserialize: (value: Buffer) => StatusResponse;
494
+ };
458
495
  /** --- Cars (Admin-UI, #115 — eigenes Modell + user_to_car-Pivot statt Settings-JSON-Blob) --- */
459
496
  readonly getCars: {
460
497
  readonly path: "/hannah.HannahService/GetCars";
@@ -934,6 +971,11 @@ export interface HannahServiceServer extends UntypedServiceImplementation {
934
971
  createBleTag: handleUnaryCall<CreateBleTagRequest, CreateBleTagResponse>;
935
972
  updateBleTag: handleUnaryCall<UpdateBleTagRequest, StatusResponse>;
936
973
  deleteBleTag: handleUnaryCall<DeleteBleTagRequest, StatusResponse>;
974
+ /** --- Presence Sources (Admin-UI, hannah#294 — presence fusion) --- */
975
+ getPresenceSources: handleUnaryCall<Empty, GetPresenceSourcesResponse>;
976
+ createPresenceSource: handleUnaryCall<CreatePresenceSourceRequest, CreatePresenceSourceResponse>;
977
+ updatePresenceSource: handleUnaryCall<UpdatePresenceSourceRequest, StatusResponse>;
978
+ deletePresenceSource: handleUnaryCall<DeletePresenceSourceRequest, StatusResponse>;
937
979
  /** --- Cars (Admin-UI, #115 — eigenes Modell + user_to_car-Pivot statt Settings-JSON-Blob) --- */
938
980
  getCars: handleUnaryCall<Empty, GetCarsResponse>;
939
981
  createCar: handleUnaryCall<CreateCarRequest, CreateCarResponse>;
@@ -1245,6 +1287,19 @@ export interface HannahServiceClient extends Client {
1245
1287
  deleteBleTag(request: DeleteBleTagRequest, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1246
1288
  deleteBleTag(request: DeleteBleTagRequest, metadata: Metadata, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1247
1289
  deleteBleTag(request: DeleteBleTagRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1290
+ /** --- Presence Sources (Admin-UI, hannah#294 — presence fusion) --- */
1291
+ getPresenceSources(request: Empty, callback: (error: ServiceError | null, response: GetPresenceSourcesResponse) => void): ClientUnaryCall;
1292
+ getPresenceSources(request: Empty, metadata: Metadata, callback: (error: ServiceError | null, response: GetPresenceSourcesResponse) => void): ClientUnaryCall;
1293
+ getPresenceSources(request: Empty, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: GetPresenceSourcesResponse) => void): ClientUnaryCall;
1294
+ createPresenceSource(request: CreatePresenceSourceRequest, callback: (error: ServiceError | null, response: CreatePresenceSourceResponse) => void): ClientUnaryCall;
1295
+ createPresenceSource(request: CreatePresenceSourceRequest, metadata: Metadata, callback: (error: ServiceError | null, response: CreatePresenceSourceResponse) => void): ClientUnaryCall;
1296
+ createPresenceSource(request: CreatePresenceSourceRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: CreatePresenceSourceResponse) => void): ClientUnaryCall;
1297
+ updatePresenceSource(request: UpdatePresenceSourceRequest, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1298
+ updatePresenceSource(request: UpdatePresenceSourceRequest, metadata: Metadata, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1299
+ updatePresenceSource(request: UpdatePresenceSourceRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1300
+ deletePresenceSource(request: DeletePresenceSourceRequest, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1301
+ deletePresenceSource(request: DeletePresenceSourceRequest, metadata: Metadata, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1302
+ deletePresenceSource(request: DeletePresenceSourceRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1248
1303
  /** --- Cars (Admin-UI, #115 — eigenes Modell + user_to_car-Pivot statt Settings-JSON-Blob) --- */
1249
1304
  getCars(request: Empty, callback: (error: ServiceError | null, response: GetCarsResponse) => void): ClientUnaryCall;
1250
1305
  getCars(request: Empty, metadata: Metadata, callback: (error: ServiceError | null, response: GetCarsResponse) => void): ClientUnaryCall;
package/dist/hannah.js CHANGED
@@ -463,6 +463,43 @@ exports.HannahServiceService = {
463
463
  responseSerialize: (value) => Buffer.from(shared_1.StatusResponse.encode(value).finish()),
464
464
  responseDeserialize: (value) => shared_1.StatusResponse.decode(value),
465
465
  },
466
+ /** --- Presence Sources (Admin-UI, hannah#294 — presence fusion) --- */
467
+ getPresenceSources: {
468
+ path: "/hannah.HannahService/GetPresenceSources",
469
+ requestStream: false,
470
+ responseStream: false,
471
+ requestSerialize: (value) => Buffer.from(shared_1.Empty.encode(value).finish()),
472
+ requestDeserialize: (value) => shared_1.Empty.decode(value),
473
+ responseSerialize: (value) => Buffer.from(control_1.GetPresenceSourcesResponse.encode(value).finish()),
474
+ responseDeserialize: (value) => control_1.GetPresenceSourcesResponse.decode(value),
475
+ },
476
+ createPresenceSource: {
477
+ path: "/hannah.HannahService/CreatePresenceSource",
478
+ requestStream: false,
479
+ responseStream: false,
480
+ requestSerialize: (value) => Buffer.from(control_1.CreatePresenceSourceRequest.encode(value).finish()),
481
+ requestDeserialize: (value) => control_1.CreatePresenceSourceRequest.decode(value),
482
+ responseSerialize: (value) => Buffer.from(control_1.CreatePresenceSourceResponse.encode(value).finish()),
483
+ responseDeserialize: (value) => control_1.CreatePresenceSourceResponse.decode(value),
484
+ },
485
+ updatePresenceSource: {
486
+ path: "/hannah.HannahService/UpdatePresenceSource",
487
+ requestStream: false,
488
+ responseStream: false,
489
+ requestSerialize: (value) => Buffer.from(control_1.UpdatePresenceSourceRequest.encode(value).finish()),
490
+ requestDeserialize: (value) => control_1.UpdatePresenceSourceRequest.decode(value),
491
+ responseSerialize: (value) => Buffer.from(shared_1.StatusResponse.encode(value).finish()),
492
+ responseDeserialize: (value) => shared_1.StatusResponse.decode(value),
493
+ },
494
+ deletePresenceSource: {
495
+ path: "/hannah.HannahService/DeletePresenceSource",
496
+ requestStream: false,
497
+ responseStream: false,
498
+ requestSerialize: (value) => Buffer.from(control_1.DeletePresenceSourceRequest.encode(value).finish()),
499
+ requestDeserialize: (value) => control_1.DeletePresenceSourceRequest.decode(value),
500
+ responseSerialize: (value) => Buffer.from(shared_1.StatusResponse.encode(value).finish()),
501
+ responseDeserialize: (value) => shared_1.StatusResponse.decode(value),
502
+ },
466
503
  /** --- Cars (Admin-UI, #115 — eigenes Modell + user_to_car-Pivot statt Settings-JSON-Blob) --- */
467
504
  getCars: {
468
505
  path: "/hannah.HannahService/GetCars",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m1kad0/hannah-proto",
3
- "version": "4.0.0",
3
+ "version": "4.2.0",
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",