@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.
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 +67 -0
  20. package/dist/v2/device_control_menu.js +328 -0
  21. package/dist/v2/device_model.d.ts +199 -0
  22. package/dist/v2/device_model.js +713 -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 +1 -1
  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,199 @@
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 - Thermostat/room climate. Slots: TARGET_TEMPERATURE (required), TEMPERATURE,
20
+ * HUMIDITY, VALVE. Comfort/eco setpoints and similar are not slots.
21
+ */
22
+ DEVICE_CLASS_THERMOSTAT = 4,
23
+ /** DEVICE_CLASS_COVER - Blind, shutter, awning. Slots: POSITION (required), TILT, STOP. */
24
+ DEVICE_CLASS_COVER = 5,
25
+ /**
26
+ * DEVICE_CLASS_SENSOR - Read-only measurements. At least one measurement slot: TEMPERATURE, HUMIDITY,
27
+ * ILLUMINANCE, PRESSURE, CO2, IAQ, VOC, POWER, ENERGY, MOTION.
28
+ */
29
+ DEVICE_CLASS_SENSOR = 6,
30
+ /** DEVICE_CLASS_CONTACT - Door or window contact. Slots: OPEN (required, read-only). */
31
+ DEVICE_CLASS_CONTACT = 7,
32
+ /**
33
+ * DEVICE_CLASS_GENERIC - Fallback for anything that matches no class: a list of typed values
34
+ * (GENERIC_NUMBER / GENERIC_BOOL / GENERIC_TEXT), each with label and unit.
35
+ */
36
+ DEVICE_CLASS_GENERIC = 8,
37
+ UNRECOGNIZED = -1
38
+ }
39
+ /**
40
+ * What a slot means, and therefore which scale and unit its value has. The adapter
41
+ * normalizes every value to exactly this scale; Core relies on it.
42
+ */
43
+ export declare enum SlotKind {
44
+ SLOT_KIND_UNSPECIFIED = 0,
45
+ /** SLOT_KIND_ON - --- switching and light --- */
46
+ SLOT_KIND_ON = 1,
47
+ /** SLOT_KIND_BRIGHTNESS - number, 0-100 (%) */
48
+ SLOT_KIND_BRIGHTNESS = 2,
49
+ /** SLOT_KIND_COLOR - rgb, 0xRRGGBB */
50
+ SLOT_KIND_COLOR = 3,
51
+ /** SLOT_KIND_COLOR_TEMPERATURE - number, Kelvin (e.g. 2700 warm white, 6500 cold white) */
52
+ SLOT_KIND_COLOR_TEMPERATURE = 4,
53
+ /** SLOT_KIND_POWER - --- electricity --- */
54
+ SLOT_KIND_POWER = 10,
55
+ /** SLOT_KIND_ENERGY - number, kWh (cumulative) */
56
+ SLOT_KIND_ENERGY = 11,
57
+ /** SLOT_KIND_VOLTAGE - number, V */
58
+ SLOT_KIND_VOLTAGE = 12,
59
+ /** SLOT_KIND_CURRENT - number, A */
60
+ SLOT_KIND_CURRENT = 13,
61
+ /** SLOT_KIND_TARGET_TEMPERATURE - --- climate --- */
62
+ SLOT_KIND_TARGET_TEMPERATURE = 20,
63
+ /** SLOT_KIND_TEMPERATURE - number, °C, measured value */
64
+ SLOT_KIND_TEMPERATURE = 21,
65
+ /** SLOT_KIND_HUMIDITY - number, 0-100 (% relative) */
66
+ SLOT_KIND_HUMIDITY = 22,
67
+ /** SLOT_KIND_VALVE - number, 0-100 (% open) */
68
+ SLOT_KIND_VALVE = 23,
69
+ /** SLOT_KIND_POSITION - --- cover --- */
70
+ SLOT_KIND_POSITION = 30,
71
+ /** SLOT_KIND_TILT - number, 0-100 (%) */
72
+ SLOT_KIND_TILT = 31,
73
+ /** SLOT_KIND_STOP - boolean trigger: true = stop movement, not a state */
74
+ SLOT_KIND_STOP = 32,
75
+ /** SLOT_KIND_OPEN - --- binary sensors --- */
76
+ SLOT_KIND_OPEN = 40,
77
+ /** SLOT_KIND_MOTION - boolean: true = motion/presence detected */
78
+ SLOT_KIND_MOTION = 41,
79
+ /** SLOT_KIND_ILLUMINANCE - --- further measurements --- */
80
+ SLOT_KIND_ILLUMINANCE = 50,
81
+ /** SLOT_KIND_PRESSURE - number, hPa */
82
+ SLOT_KIND_PRESSURE = 51,
83
+ /** SLOT_KIND_CO2 - number, ppm */
84
+ SLOT_KIND_CO2 = 52,
85
+ /** SLOT_KIND_IAQ - number, index 0-500 */
86
+ SLOT_KIND_IAQ = 53,
87
+ /** SLOT_KIND_VOC - number, ppm */
88
+ SLOT_KIND_VOC = 54,
89
+ /** SLOT_KIND_GENERIC_NUMBER - --- generic values (DEVICE_CLASS_GENERIC), described by label and unit --- */
90
+ SLOT_KIND_GENERIC_NUMBER = 90,
91
+ SLOT_KIND_GENERIC_BOOL = 91,
92
+ SLOT_KIND_GENERIC_TEXT = 92,
93
+ UNRECOGNIZED = -1
94
+ }
95
+ /** The value of a slot, typed. Which case is used follows from the SlotKind. */
96
+ export interface SlotValue {
97
+ boolean?: boolean | undefined;
98
+ number?: number | undefined;
99
+ text?: string | undefined;
100
+ /** 0xRRGGBB, used by SLOT_KIND_COLOR */
101
+ rgb?: number | undefined;
102
+ }
103
+ /** One capability of a device. */
104
+ export interface Slot {
105
+ /**
106
+ * Stable ID of this slot within its device, chosen by the adapter. For the standard
107
+ * kinds the lowercase kind name without prefix ("on", "brightness", "target_temperature")
108
+ * is recommended; it is what SlotUpdate and SetSlot address. GENERIC slots need it
109
+ * because a device can carry several of the same kind.
110
+ */
111
+ slotId: string;
112
+ kind: SlotKind;
113
+ /** current value; unset = unknown */
114
+ value: SlotValue | undefined;
115
+ /** false = read-only (measurements, contacts) */
116
+ writable: boolean;
117
+ /** informational, and for GENERIC slots; standard kinds have a fixed unit (see SlotKind) */
118
+ unit: string;
119
+ /** human-readable name, used by GENERIC slots */
120
+ label: string;
121
+ /**
122
+ * Minimum user trust level (0-10, same scale as the users' trust level) required to
123
+ * control this slot, read by the adapter from common.custom["hannah.0"].neededTrust.
124
+ * Unset = not configured, no restriction — distinct from an explicit 0.
125
+ */
126
+ requiredTrustLevel?: number | undefined;
127
+ }
128
+ /** A device, as the adapter derived it from the ioBroker objects (grouping, class, slots). */
129
+ export interface TypedDevice {
130
+ /** stable ID of the device, chosen by the adapter; not an ioBroker state ID */
131
+ deviceId: string;
132
+ /** display name, mandatory */
133
+ name: string;
134
+ /** room_id (enum ID segment, see AgentRoom), mandatory */
135
+ room: string;
136
+ /** floor, empty = none */
137
+ floor: string;
138
+ deviceClass: DeviceClass;
139
+ slots: Slot[];
140
+ /** false = device currently unreachable */
141
+ available: boolean;
142
+ }
143
+ /**
144
+ * All devices the adapter knows. Sent on AgentConnect and whenever the set of devices
145
+ * or their structure changes (devices added/removed, slots added/removed).
146
+ */
147
+ export interface TypedDeviceSnapshot {
148
+ devices: TypedDevice[];
149
+ }
150
+ /**
151
+ * A slot changed. ack=true means the device confirmed the value (as opposed to the
152
+ * "desired" value), Hannah uses this to verify that a SetSlot was executed.
153
+ */
154
+ export interface SlotUpdate {
155
+ deviceId: string;
156
+ slotId: string;
157
+ value: SlotValue | undefined;
158
+ ack: boolean;
159
+ /** Unix timestamp in milliseconds */
160
+ ts: bigint;
161
+ }
162
+ /** A device became reachable or unreachable, without any of its slots changing. */
163
+ export interface DeviceAvailability {
164
+ deviceId: string;
165
+ available: boolean;
166
+ }
167
+ /**
168
+ * Hannah wants to control a slot. The adapter maps this onto the real state(s) and
169
+ * denormalizes the value; the confirmed result comes back as a SlotUpdate with ack=true.
170
+ */
171
+ export interface SetSlot {
172
+ deviceId: string;
173
+ slotId: string;
174
+ value: SlotValue | undefined;
175
+ }
176
+ export declare const SlotValue: MessageFns<SlotValue>;
177
+ export declare const Slot: MessageFns<Slot>;
178
+ export declare const TypedDevice: MessageFns<TypedDevice>;
179
+ export declare const TypedDeviceSnapshot: MessageFns<TypedDeviceSnapshot>;
180
+ export declare const SlotUpdate: MessageFns<SlotUpdate>;
181
+ export declare const DeviceAvailability: MessageFns<DeviceAvailability>;
182
+ export declare const SetSlot: MessageFns<SetSlot>;
183
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
184
+ 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 {} ? {
185
+ [K in keyof T]?: DeepPartial<T[K]>;
186
+ } : Partial<T>;
187
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
188
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
189
+ [K in keyof P]: Exact<P[K], I[K]>;
190
+ } & {
191
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
192
+ };
193
+ export interface MessageFns<T> {
194
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
195
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
196
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
197
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
198
+ }
199
+ export {};