@m1kad0/hannah-proto 4.1.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 +33 -1
- package/dist/agent.js +32 -2
- package/dist/descriptor.binpb +0 -0
- package/package.json +1 -1
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
|
-
/**
|
|
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
|
};
|
package/dist/descriptor.binpb
CHANGED
|
Binary file
|
package/package.json
CHANGED