@m1kad0/hannah-proto 4.8.0 → 5.1.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.
Files changed (60) hide show
  1. package/README.md +20 -12
  2. package/dist/compat_interceptor.js +1 -1
  3. package/dist/compat_versions.js +89 -89
  4. package/dist/descriptor.binpb +0 -0
  5. package/dist/index.d.ts +1 -22
  6. package/dist/index.js +2 -23
  7. package/dist/{activity_log.d.ts → v2/activity_log.d.ts} +1 -1
  8. package/dist/{activity_log.js → v2/activity_log.js} +2 -2
  9. package/dist/{agent.d.ts → v2/agent.d.ts} +61 -86
  10. package/dist/{agent.js → v2/agent.js} +224 -426
  11. package/dist/{automation.d.ts → v2/automation.d.ts} +1 -1
  12. package/dist/{automation.js → v2/automation.js} +2 -2
  13. package/dist/{car_state.d.ts → v2/car_state.d.ts} +1 -1
  14. package/dist/{car_state.js → v2/car_state.js} +2 -2
  15. package/dist/{channel.d.ts → v2/channel.d.ts} +1 -1
  16. package/dist/{channel.js → v2/channel.js} +2 -2
  17. package/dist/{control.d.ts → v2/control.d.ts} +1 -1
  18. package/dist/{control.js → v2/control.js} +2 -2
  19. package/dist/v2/device_control_menu.d.ts +69 -0
  20. package/dist/v2/device_control_menu.js +339 -0
  21. package/dist/v2/device_model.d.ts +240 -0
  22. package/dist/v2/device_model.js +777 -0
  23. package/dist/{event_stream.d.ts → v2/event_stream.d.ts} +1 -1
  24. package/dist/{event_stream.js → v2/event_stream.js} +2 -2
  25. package/dist/{hannah.d.ts → v2/hannah.d.ts} +86 -86
  26. package/dist/{hannah.js → v2/hannah.js} +88 -88
  27. package/dist/v2/index.d.ts +23 -0
  28. package/dist/v2/index.js +59 -0
  29. package/dist/{infrastructure.d.ts → v2/infrastructure.d.ts} +1 -1
  30. package/dist/{infrastructure.js → v2/infrastructure.js} +2 -2
  31. package/dist/{logging.d.ts → v2/logging.d.ts} +4 -4
  32. package/dist/{logging.js → v2/logging.js} +6 -6
  33. package/dist/{messages.d.ts → v2/messages.d.ts} +1 -1
  34. package/dist/{messages.js → v2/messages.js} +2 -2
  35. package/dist/{satellite.d.ts → v2/satellite.d.ts} +1 -1
  36. package/dist/{satellite.js → v2/satellite.js} +2 -2
  37. package/dist/{satellite_provisioning.d.ts → v2/satellite_provisioning.d.ts} +1 -1
  38. package/dist/{satellite_provisioning.js → v2/satellite_provisioning.js} +2 -2
  39. package/dist/{satellite_proxy.d.ts → v2/satellite_proxy.d.ts} +1 -1
  40. package/dist/{satellite_proxy.js → v2/satellite_proxy.js} +2 -2
  41. package/dist/{shared.d.ts → v2/shared.d.ts} +1 -28
  42. package/dist/v2/shared.js +113 -0
  43. package/dist/{speaker_enrollment.d.ts → v2/speaker_enrollment.d.ts} +1 -1
  44. package/dist/{speaker_enrollment.js → v2/speaker_enrollment.js} +2 -2
  45. package/dist/{timer_admin.d.ts → v2/timer_admin.d.ts} +1 -1
  46. package/dist/{timer_admin.js → v2/timer_admin.js} +2 -2
  47. package/dist/{timer_service.d.ts → v2/timer_service.d.ts} +1 -1
  48. package/dist/{timer_service.js → v2/timer_service.js} +2 -2
  49. package/dist/{user_registry.d.ts → v2/user_registry.d.ts} +1 -1
  50. package/dist/{user_registry.js → v2/user_registry.js} +2 -2
  51. package/dist/{wakeword_capture.d.ts → v2/wakeword_capture.d.ts} +1 -1
  52. package/dist/{wakeword_capture.js → v2/wakeword_capture.js} +2 -2
  53. package/dist/{weather.d.ts → v2/weather.d.ts} +1 -1
  54. package/dist/{weather.js → v2/weather.js} +2 -2
  55. package/dist/version.d.ts +1 -1
  56. package/dist/version.js +1 -1
  57. package/package.json +2 -2
  58. package/dist/device_control_menu.d.ts +0 -88
  59. package/dist/device_control_menu.js +0 -629
  60. package/dist/shared.js +0 -249
@@ -0,0 +1,240 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "hannah.v2";
3
+ /**
4
+ * What kind of device this is. A class exists per family of verbs, not per feature:
5
+ * a measuring socket is a SOCKET with a filled POWER slot, not a class of its own.
6
+ */
7
+ export declare enum DeviceClass {
8
+ DEVICE_CLASS_UNSPECIFIED = 0,
9
+ /** DEVICE_CLASS_LIGHT - Switchable light. Slots: ON (required), BRIGHTNESS, COLOR, COLOR_TEMPERATURE. */
10
+ DEVICE_CLASS_LIGHT = 1,
11
+ /** DEVICE_CLASS_SOCKET - Socket/plug. Slots: ON (required), POWER, ENERGY, VOLTAGE, CURRENT. */
12
+ DEVICE_CLASS_SOCKET = 2,
13
+ /**
14
+ * DEVICE_CLASS_GENERIC_BINARY_SWITCH - Any other switchable boolean that fits no other class (scene-like switches,
15
+ * flags, vendor specific switches). Slots: ON (required).
16
+ */
17
+ DEVICE_CLASS_GENERIC_BINARY_SWITCH = 3,
18
+ /**
19
+ * DEVICE_CLASS_THERMOSTAT - Radiator or room thermostat. Slots: TARGET_TEMPERATURE (required), TEMPERATURE,
20
+ * HUMIDITY, VALVE. Comfort/eco setpoints and similar are not slots. Units with an
21
+ * operating mode and a fan are DEVICE_CLASS_CLIMATE.
22
+ */
23
+ DEVICE_CLASS_THERMOSTAT = 4,
24
+ /** DEVICE_CLASS_COVER - Blind, shutter, awning. Slots: POSITION (required), TILT, STOP. */
25
+ DEVICE_CLASS_COVER = 5,
26
+ /**
27
+ * DEVICE_CLASS_SENSOR - Read-only measurements. At least one measurement slot: TEMPERATURE, HUMIDITY,
28
+ * ILLUMINANCE, PRESSURE, CO2, IAQ, VOC, POWER, ENERGY, MOTION.
29
+ */
30
+ DEVICE_CLASS_SENSOR = 6,
31
+ /** DEVICE_CLASS_CONTACT - Door or window contact. Slots: OPEN (required, read-only). */
32
+ DEVICE_CLASS_CONTACT = 7,
33
+ /**
34
+ * DEVICE_CLASS_GENERIC - Fallback for anything that matches no class: a list of typed values
35
+ * (GENERIC_NUMBER / GENERIC_BOOL / GENERIC_TEXT), each with label and unit.
36
+ */
37
+ DEVICE_CLASS_GENERIC = 8,
38
+ /**
39
+ * DEVICE_CLASS_CLIMATE - Air conditioner / room climate unit with operating mode and fan. Slots: ON (required),
40
+ * MODE, TARGET_TEMPERATURE, TEMPERATURE, HUMIDITY, FAN_SPEED. A radiator thermostat
41
+ * without mode and fan is a THERMOSTAT, not a CLIMATE.
42
+ */
43
+ DEVICE_CLASS_CLIMATE = 9,
44
+ UNRECOGNIZED = -1
45
+ }
46
+ /**
47
+ * A finer kind within a device class, for the cases where the class alone does not say
48
+ * what a user means ("the windows" versus "the doors"). Optional: the adapter sets it
49
+ * where it knows (function, role, type detector), otherwise UNSPECIFIED.
50
+ */
51
+ export declare enum DeviceSubtype {
52
+ /** DEVICE_SUBTYPE_UNSPECIFIED - No statement. Hannah Core may fall back to the device name. */
53
+ DEVICE_SUBTYPE_UNSPECIFIED = 0,
54
+ /** DEVICE_SUBTYPE_WINDOW - DEVICE_CLASS_CONTACT: window contact. */
55
+ DEVICE_SUBTYPE_WINDOW = 1,
56
+ /** DEVICE_SUBTYPE_DOOR - DEVICE_CLASS_CONTACT: door contact. */
57
+ DEVICE_SUBTYPE_DOOR = 2,
58
+ UNRECOGNIZED = -1
59
+ }
60
+ /**
61
+ * What a slot means, and therefore which scale and unit its value has. The adapter
62
+ * normalizes every value to exactly this scale; Core relies on it.
63
+ */
64
+ export declare enum SlotKind {
65
+ SLOT_KIND_UNSPECIFIED = 0,
66
+ /** SLOT_KIND_ON - --- switching and light --- */
67
+ SLOT_KIND_ON = 1,
68
+ /** SLOT_KIND_BRIGHTNESS - number, 0-100 (%) */
69
+ SLOT_KIND_BRIGHTNESS = 2,
70
+ /** SLOT_KIND_COLOR - rgb, 0xRRGGBB */
71
+ SLOT_KIND_COLOR = 3,
72
+ /** SLOT_KIND_COLOR_TEMPERATURE - number, Kelvin (e.g. 2700 warm white, 6500 cold white) */
73
+ SLOT_KIND_COLOR_TEMPERATURE = 4,
74
+ /** SLOT_KIND_POWER - --- electricity --- */
75
+ SLOT_KIND_POWER = 10,
76
+ /** SLOT_KIND_ENERGY - number, kWh (cumulative) */
77
+ SLOT_KIND_ENERGY = 11,
78
+ /** SLOT_KIND_VOLTAGE - number, V */
79
+ SLOT_KIND_VOLTAGE = 12,
80
+ /** SLOT_KIND_CURRENT - number, A */
81
+ SLOT_KIND_CURRENT = 13,
82
+ /** SLOT_KIND_TARGET_TEMPERATURE - --- climate --- */
83
+ SLOT_KIND_TARGET_TEMPERATURE = 20,
84
+ /** SLOT_KIND_TEMPERATURE - number, °C, measured value */
85
+ SLOT_KIND_TEMPERATURE = 21,
86
+ /** SLOT_KIND_HUMIDITY - number, 0-100 (% relative) */
87
+ SLOT_KIND_HUMIDITY = 22,
88
+ /** SLOT_KIND_VALVE - number, 0-100 (% open) */
89
+ SLOT_KIND_VALVE = 23,
90
+ /**
91
+ * SLOT_KIND_MODE - Operating mode of a CLIMATE device, text, one of: "cool", "heat", "dry", "fan_only",
92
+ * "auto". The adapter normalizes the device's own values to this vocabulary. The modes the
93
+ * device really supports are listed in Slot.options.
94
+ */
95
+ SLOT_KIND_MODE = 24,
96
+ /**
97
+ * SLOT_KIND_FAN_SPEED - Fan level of a CLIMATE device, text, one of: "low", "medium", "high", "auto". Supported
98
+ * levels are listed in Slot.options.
99
+ */
100
+ SLOT_KIND_FAN_SPEED = 25,
101
+ /** SLOT_KIND_POSITION - --- cover --- */
102
+ SLOT_KIND_POSITION = 30,
103
+ /** SLOT_KIND_TILT - number, 0-100 (%) */
104
+ SLOT_KIND_TILT = 31,
105
+ /** SLOT_KIND_STOP - boolean trigger: true = stop movement, not a state */
106
+ SLOT_KIND_STOP = 32,
107
+ /** SLOT_KIND_OPEN - --- binary sensors --- */
108
+ SLOT_KIND_OPEN = 40,
109
+ /** SLOT_KIND_MOTION - boolean: true = motion/presence detected */
110
+ SLOT_KIND_MOTION = 41,
111
+ /** SLOT_KIND_ILLUMINANCE - --- further measurements --- */
112
+ SLOT_KIND_ILLUMINANCE = 50,
113
+ /** SLOT_KIND_PRESSURE - number, hPa */
114
+ SLOT_KIND_PRESSURE = 51,
115
+ /** SLOT_KIND_CO2 - number, ppm */
116
+ SLOT_KIND_CO2 = 52,
117
+ /** SLOT_KIND_IAQ - number, index 0-500 */
118
+ SLOT_KIND_IAQ = 53,
119
+ /** SLOT_KIND_VOC - number, ppm */
120
+ SLOT_KIND_VOC = 54,
121
+ /** SLOT_KIND_GENERIC_NUMBER - --- generic values (DEVICE_CLASS_GENERIC), described by label and unit --- */
122
+ SLOT_KIND_GENERIC_NUMBER = 90,
123
+ SLOT_KIND_GENERIC_BOOL = 91,
124
+ SLOT_KIND_GENERIC_TEXT = 92,
125
+ UNRECOGNIZED = -1
126
+ }
127
+ /** The value of a slot, typed. Which case is used follows from the SlotKind. */
128
+ export interface SlotValue {
129
+ boolean?: boolean | undefined;
130
+ number?: number | undefined;
131
+ text?: string | undefined;
132
+ /** 0xRRGGBB, used by SLOT_KIND_COLOR */
133
+ rgb?: number | undefined;
134
+ }
135
+ /** One capability of a device. */
136
+ export interface Slot {
137
+ /**
138
+ * Stable ID of this slot within its device, chosen by the adapter. For the standard
139
+ * kinds the lowercase kind name without prefix ("on", "brightness", "target_temperature")
140
+ * is recommended; it is what SlotUpdate and SetSlot address. GENERIC slots need it
141
+ * because a device can carry several of the same kind.
142
+ */
143
+ slotId: string;
144
+ kind: SlotKind;
145
+ /** current value; unset = unknown */
146
+ value: SlotValue | undefined;
147
+ /** false = read-only (measurements, contacts) */
148
+ writable: boolean;
149
+ /** informational, and for GENERIC slots; standard kinds have a fixed unit (see SlotKind) */
150
+ unit: string;
151
+ /** human-readable name, used by GENERIC slots */
152
+ label: string;
153
+ /**
154
+ * Minimum user trust level (0-10, same scale as the users' trust level) required to
155
+ * control this slot, read by the adapter from common.custom["hannah.0"].neededTrust.
156
+ * Unset = not configured, no restriction — distinct from an explicit 0.
157
+ */
158
+ requiredTrustLevel?: number | undefined;
159
+ /**
160
+ * The values this slot accepts, for SLOT_KIND_MODE and SLOT_KIND_FAN_SPEED, taken from the
161
+ * vocabulary of the kind (e.g. a cooling-only unit lists just "cool", "dry", "fan_only").
162
+ * Empty = no statement, every value of the vocabulary may work. Hannah uses it to answer
163
+ * honestly when a device cannot do what was asked.
164
+ */
165
+ options: string[];
166
+ }
167
+ /** A device, as the adapter derived it from the ioBroker objects (grouping, class, slots). */
168
+ export interface TypedDevice {
169
+ /** stable ID of the device, chosen by the adapter; not an ioBroker state ID */
170
+ deviceId: string;
171
+ /** display name, mandatory */
172
+ name: string;
173
+ /** room_id (enum ID segment, see AgentRoom), mandatory */
174
+ room: string;
175
+ /** floor, empty = none */
176
+ floor: string;
177
+ deviceClass: DeviceClass;
178
+ slots: Slot[];
179
+ /** false = device currently unreachable */
180
+ available: boolean;
181
+ /** finer kind within the class, UNSPECIFIED = no statement */
182
+ subtype: DeviceSubtype;
183
+ }
184
+ /**
185
+ * All devices the adapter knows. Sent on AgentConnect and whenever the set of devices
186
+ * or their structure changes (devices added/removed, slots added/removed).
187
+ */
188
+ export interface TypedDeviceSnapshot {
189
+ devices: TypedDevice[];
190
+ }
191
+ /**
192
+ * A slot changed. ack=true means the device confirmed the value (as opposed to the
193
+ * "desired" value), Hannah uses this to verify that a SetSlot was executed.
194
+ */
195
+ export interface SlotUpdate {
196
+ deviceId: string;
197
+ slotId: string;
198
+ value: SlotValue | undefined;
199
+ ack: boolean;
200
+ /** Unix timestamp in milliseconds */
201
+ ts: bigint;
202
+ }
203
+ /** A device became reachable or unreachable, without any of its slots changing. */
204
+ export interface DeviceAvailability {
205
+ deviceId: string;
206
+ available: boolean;
207
+ }
208
+ /**
209
+ * Hannah wants to control a slot. The adapter maps this onto the real state(s) and
210
+ * denormalizes the value; the confirmed result comes back as a SlotUpdate with ack=true.
211
+ */
212
+ export interface SetSlot {
213
+ deviceId: string;
214
+ slotId: string;
215
+ value: SlotValue | undefined;
216
+ }
217
+ export declare const SlotValue: MessageFns<SlotValue>;
218
+ export declare const Slot: MessageFns<Slot>;
219
+ export declare const TypedDevice: MessageFns<TypedDevice>;
220
+ export declare const TypedDeviceSnapshot: MessageFns<TypedDeviceSnapshot>;
221
+ export declare const SlotUpdate: MessageFns<SlotUpdate>;
222
+ export declare const DeviceAvailability: MessageFns<DeviceAvailability>;
223
+ export declare const SetSlot: MessageFns<SetSlot>;
224
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
225
+ 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 {} ? {
226
+ [K in keyof T]?: DeepPartial<T[K]>;
227
+ } : Partial<T>;
228
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
229
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
230
+ [K in keyof P]: Exact<P[K], I[K]>;
231
+ } & {
232
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
233
+ };
234
+ export interface MessageFns<T> {
235
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
236
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
237
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
238
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
239
+ }
240
+ export {};