@m1kad0/hannah-proto 1.0.2 → 1.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.
- package/dist/agent.d.ts +2 -0
- package/dist/agent.js +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/weather.d.ts +81 -0
- package/dist/weather.js +336 -0
- package/package.json +1 -1
package/dist/agent.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
import { EnumValues, StateType } from "./shared";
|
|
3
|
+
import { AgentWeatherUpdate } from "./weather";
|
|
3
4
|
export declare const protobufPackage = "hannah";
|
|
4
5
|
export declare enum ResidentType {
|
|
5
6
|
RESIDENT_TYPE_UNSPECIFIED = 0,
|
|
@@ -26,6 +27,7 @@ export interface AgentMessage {
|
|
|
26
27
|
askResident?: AgentAskResident | undefined;
|
|
27
28
|
/** full room catalog, independent of devices */
|
|
28
29
|
sendRooms?: AgentRoomSnapshot | undefined;
|
|
30
|
+
weatherUpdate?: AgentWeatherUpdate | undefined;
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
33
|
* Adapter instructs Hannah to control satellites in a room or a specific satellite.
|
package/dist/agent.js
CHANGED
|
@@ -9,6 +9,7 @@ exports.AgentSensorUpdate = exports.AgentBleUpdate = exports.AgentResidentAnswer
|
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
const shared_1 = require("./shared");
|
|
12
|
+
const weather_1 = require("./weather");
|
|
12
13
|
exports.protobufPackage = "hannah";
|
|
13
14
|
var ResidentType;
|
|
14
15
|
(function (ResidentType) {
|
|
@@ -28,6 +29,7 @@ function createBaseAgentMessage() {
|
|
|
28
29
|
sendResidents: undefined,
|
|
29
30
|
askResident: undefined,
|
|
30
31
|
sendRooms: undefined,
|
|
32
|
+
weatherUpdate: undefined,
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
35
|
exports.AgentMessage = {
|
|
@@ -56,6 +58,9 @@ exports.AgentMessage = {
|
|
|
56
58
|
if (message.sendRooms !== undefined) {
|
|
57
59
|
exports.AgentRoomSnapshot.encode(message.sendRooms, writer.uint32(66).fork()).join();
|
|
58
60
|
}
|
|
61
|
+
if (message.weatherUpdate !== undefined) {
|
|
62
|
+
weather_1.AgentWeatherUpdate.encode(message.weatherUpdate, writer.uint32(74).fork()).join();
|
|
63
|
+
}
|
|
59
64
|
return writer;
|
|
60
65
|
},
|
|
61
66
|
decode(input, length) {
|
|
@@ -121,6 +126,13 @@ exports.AgentMessage = {
|
|
|
121
126
|
message.sendRooms = exports.AgentRoomSnapshot.decode(reader, reader.uint32());
|
|
122
127
|
continue;
|
|
123
128
|
}
|
|
129
|
+
case 9: {
|
|
130
|
+
if (tag !== 74) {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
message.weatherUpdate = weather_1.AgentWeatherUpdate.decode(reader, reader.uint32());
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
124
136
|
}
|
|
125
137
|
if ((tag & 7) === 4 || tag === 0) {
|
|
126
138
|
break;
|
|
@@ -158,6 +170,9 @@ exports.AgentMessage = {
|
|
|
158
170
|
message.sendRooms = (object.sendRooms !== undefined && object.sendRooms !== null)
|
|
159
171
|
? exports.AgentRoomSnapshot.fromPartial(object.sendRooms)
|
|
160
172
|
: undefined;
|
|
173
|
+
message.weatherUpdate = (object.weatherUpdate !== undefined && object.weatherUpdate !== null)
|
|
174
|
+
? weather_1.AgentWeatherUpdate.fromPartial(object.weatherUpdate)
|
|
175
|
+
: undefined;
|
|
161
176
|
return message;
|
|
162
177
|
},
|
|
163
178
|
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.wakeword_capture = exports.user_registry = exports.timer_service = exports.timer_admin = exports.speaker_enrollment = exports.shared = exports.satellite_proxy = exports.satellite_provisioning = exports.hannah = exports.event_stream = exports.device_control_menu = exports.control = exports.car_state = exports.automation = exports.agent = void 0;
|
|
39
|
+
exports.weather = exports.wakeword_capture = exports.user_registry = exports.timer_service = exports.timer_admin = exports.speaker_enrollment = exports.shared = exports.satellite_proxy = exports.satellite_provisioning = exports.hannah = exports.event_stream = exports.device_control_menu = exports.control = exports.car_state = exports.automation = exports.agent = void 0;
|
|
40
40
|
__exportStar(require("./version"), exports);
|
|
41
41
|
exports.agent = __importStar(require("./agent"));
|
|
42
42
|
exports.automation = __importStar(require("./automation"));
|
|
@@ -53,3 +53,4 @@ exports.timer_admin = __importStar(require("./timer_admin"));
|
|
|
53
53
|
exports.timer_service = __importStar(require("./timer_service"));
|
|
54
54
|
exports.user_registry = __importStar(require("./user_registry"));
|
|
55
55
|
exports.wakeword_capture = __importStar(require("./wakeword_capture"));
|
|
56
|
+
exports.weather = __importStar(require("./weather"));
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "hannah";
|
|
3
|
+
/**
|
|
4
|
+
* Current weather conditions, discovered by the ioBroker adapter from a configured
|
|
5
|
+
* weather source and pushed via AgentMessage.weather_update. Field set is deliberately
|
|
6
|
+
* narrow: only what core/hannah/weather.py's spoken answers actually use today, plus
|
|
7
|
+
* humidity (cheap addition). Deliberately excluded from v1 (cheap to add later, not
|
|
8
|
+
* currently used by any sentence): pressure, clouds, wind_gust, visibility, sunrise/sunset.
|
|
9
|
+
*/
|
|
10
|
+
export interface WeatherCurrentData {
|
|
11
|
+
/** °C; role value.temperature */
|
|
12
|
+
temperature: number;
|
|
13
|
+
/** % relative humidity; role value.humidity */
|
|
14
|
+
humidity?: number | undefined;
|
|
15
|
+
/** short label e.g. "Rain"; role weather.title */
|
|
16
|
+
conditionSummary: string;
|
|
17
|
+
/** longer description; role weather.state */
|
|
18
|
+
conditionDetail: string;
|
|
19
|
+
/** role weather.precipitation.rain (fallback: weather.precipitation) */
|
|
20
|
+
precipitationMm?: number | undefined;
|
|
21
|
+
/** role value.speed.wind */
|
|
22
|
+
windSpeedMs?: number | undefined;
|
|
23
|
+
/** numeric variant of role value.direction.wind */
|
|
24
|
+
windDirectionDeg?: number | undefined;
|
|
25
|
+
/** string variant of the SAME role (disambiguate via common.type) */
|
|
26
|
+
windDirectionText?: string | undefined;
|
|
27
|
+
/** Unix timestamp of the source reading; role date (unit unverified live) */
|
|
28
|
+
observedAt: bigint;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* One forecast day. day_offset 0=today .. 5=five days out, matching ioBroker's dayN
|
|
32
|
+
* channel suffix. Only day-granularity — openweathermap's 3-hourly periodN states
|
|
33
|
+
* (buggy role suffix weather.forecast.undefined) are explicitly out of scope.
|
|
34
|
+
*/
|
|
35
|
+
export interface WeatherForecastDay {
|
|
36
|
+
dayOffset: number;
|
|
37
|
+
/** role value.temperature.min */
|
|
38
|
+
temperatureMin?: number | undefined;
|
|
39
|
+
/** role value.temperature.max */
|
|
40
|
+
temperatureMax?: number | undefined;
|
|
41
|
+
/** role weather.title */
|
|
42
|
+
conditionSummary: string;
|
|
43
|
+
/** role weather.state */
|
|
44
|
+
conditionDetail: string;
|
|
45
|
+
/** role weather.precipitation.rain */
|
|
46
|
+
precipitationMm?: number | undefined;
|
|
47
|
+
/** role value.speed.wind */
|
|
48
|
+
windSpeedMs?: number | undefined;
|
|
49
|
+
/** role value.direction.wind (string variant) */
|
|
50
|
+
windDirectionText?: string | undefined;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Sent by the ioBroker adapter whenever its configured weather source changes.
|
|
54
|
+
* Full aggregated state, not a delta — Core replaces its cache wholesale on each message.
|
|
55
|
+
* current is absent until at least one value resolved; forecast is empty in "custom"
|
|
56
|
+
* mapping mode (current-conditions only, v1 scope).
|
|
57
|
+
*/
|
|
58
|
+
export interface AgentWeatherUpdate {
|
|
59
|
+
current?: WeatherCurrentData | undefined;
|
|
60
|
+
forecast: WeatherForecastDay[];
|
|
61
|
+
}
|
|
62
|
+
export declare const WeatherCurrentData: MessageFns<WeatherCurrentData>;
|
|
63
|
+
export declare const WeatherForecastDay: MessageFns<WeatherForecastDay>;
|
|
64
|
+
export declare const AgentWeatherUpdate: MessageFns<AgentWeatherUpdate>;
|
|
65
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
66
|
+
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 {} ? {
|
|
67
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
68
|
+
} : Partial<T>;
|
|
69
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
70
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
71
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
72
|
+
} & {
|
|
73
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
74
|
+
};
|
|
75
|
+
export interface MessageFns<T> {
|
|
76
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
77
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
78
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
79
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
package/dist/weather.js
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: weather.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.AgentWeatherUpdate = exports.WeatherForecastDay = exports.WeatherCurrentData = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
+
exports.protobufPackage = "hannah";
|
|
12
|
+
function createBaseWeatherCurrentData() {
|
|
13
|
+
return {
|
|
14
|
+
temperature: 0,
|
|
15
|
+
humidity: undefined,
|
|
16
|
+
conditionSummary: "",
|
|
17
|
+
conditionDetail: "",
|
|
18
|
+
precipitationMm: undefined,
|
|
19
|
+
windSpeedMs: undefined,
|
|
20
|
+
windDirectionDeg: undefined,
|
|
21
|
+
windDirectionText: undefined,
|
|
22
|
+
observedAt: 0n,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
exports.WeatherCurrentData = {
|
|
26
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
27
|
+
if (message.temperature !== 0) {
|
|
28
|
+
writer.uint32(13).float(message.temperature);
|
|
29
|
+
}
|
|
30
|
+
if (message.humidity !== undefined) {
|
|
31
|
+
writer.uint32(21).float(message.humidity);
|
|
32
|
+
}
|
|
33
|
+
if (message.conditionSummary !== "") {
|
|
34
|
+
writer.uint32(26).string(message.conditionSummary);
|
|
35
|
+
}
|
|
36
|
+
if (message.conditionDetail !== "") {
|
|
37
|
+
writer.uint32(34).string(message.conditionDetail);
|
|
38
|
+
}
|
|
39
|
+
if (message.precipitationMm !== undefined) {
|
|
40
|
+
writer.uint32(45).float(message.precipitationMm);
|
|
41
|
+
}
|
|
42
|
+
if (message.windSpeedMs !== undefined) {
|
|
43
|
+
writer.uint32(53).float(message.windSpeedMs);
|
|
44
|
+
}
|
|
45
|
+
if (message.windDirectionDeg !== undefined) {
|
|
46
|
+
writer.uint32(56).int32(message.windDirectionDeg);
|
|
47
|
+
}
|
|
48
|
+
if (message.windDirectionText !== undefined) {
|
|
49
|
+
writer.uint32(66).string(message.windDirectionText);
|
|
50
|
+
}
|
|
51
|
+
if (message.observedAt !== 0n) {
|
|
52
|
+
if (BigInt.asIntN(64, message.observedAt) !== message.observedAt) {
|
|
53
|
+
throw new globalThis.Error("value provided for field message.observedAt of type int64 too large");
|
|
54
|
+
}
|
|
55
|
+
writer.uint32(72).int64(message.observedAt);
|
|
56
|
+
}
|
|
57
|
+
return writer;
|
|
58
|
+
},
|
|
59
|
+
decode(input, length) {
|
|
60
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
61
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
62
|
+
const message = createBaseWeatherCurrentData();
|
|
63
|
+
while (reader.pos < end) {
|
|
64
|
+
const tag = reader.uint32();
|
|
65
|
+
switch (tag >>> 3) {
|
|
66
|
+
case 1: {
|
|
67
|
+
if (tag !== 13) {
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
message.temperature = reader.float();
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
case 2: {
|
|
74
|
+
if (tag !== 21) {
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
message.humidity = reader.float();
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
case 3: {
|
|
81
|
+
if (tag !== 26) {
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
message.conditionSummary = reader.string();
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
case 4: {
|
|
88
|
+
if (tag !== 34) {
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
message.conditionDetail = reader.string();
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
case 5: {
|
|
95
|
+
if (tag !== 45) {
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
message.precipitationMm = reader.float();
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
case 6: {
|
|
102
|
+
if (tag !== 53) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
message.windSpeedMs = reader.float();
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
case 7: {
|
|
109
|
+
if (tag !== 56) {
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
message.windDirectionDeg = reader.int32();
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
case 8: {
|
|
116
|
+
if (tag !== 66) {
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
message.windDirectionText = reader.string();
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
case 9: {
|
|
123
|
+
if (tag !== 72) {
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
message.observedAt = reader.int64();
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
reader.skip(tag & 7);
|
|
134
|
+
}
|
|
135
|
+
return message;
|
|
136
|
+
},
|
|
137
|
+
create(base) {
|
|
138
|
+
return exports.WeatherCurrentData.fromPartial(base ?? {});
|
|
139
|
+
},
|
|
140
|
+
fromPartial(object) {
|
|
141
|
+
const message = createBaseWeatherCurrentData();
|
|
142
|
+
message.temperature = object.temperature ?? 0;
|
|
143
|
+
message.humidity = object.humidity ?? undefined;
|
|
144
|
+
message.conditionSummary = object.conditionSummary ?? "";
|
|
145
|
+
message.conditionDetail = object.conditionDetail ?? "";
|
|
146
|
+
message.precipitationMm = object.precipitationMm ?? undefined;
|
|
147
|
+
message.windSpeedMs = object.windSpeedMs ?? undefined;
|
|
148
|
+
message.windDirectionDeg = object.windDirectionDeg ?? undefined;
|
|
149
|
+
message.windDirectionText = object.windDirectionText ?? undefined;
|
|
150
|
+
message.observedAt = (object.observedAt !== undefined && object.observedAt !== null)
|
|
151
|
+
? BigInt(object.observedAt)
|
|
152
|
+
: 0n;
|
|
153
|
+
return message;
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
function createBaseWeatherForecastDay() {
|
|
157
|
+
return {
|
|
158
|
+
dayOffset: 0,
|
|
159
|
+
temperatureMin: undefined,
|
|
160
|
+
temperatureMax: undefined,
|
|
161
|
+
conditionSummary: "",
|
|
162
|
+
conditionDetail: "",
|
|
163
|
+
precipitationMm: undefined,
|
|
164
|
+
windSpeedMs: undefined,
|
|
165
|
+
windDirectionText: undefined,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
exports.WeatherForecastDay = {
|
|
169
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
170
|
+
if (message.dayOffset !== 0) {
|
|
171
|
+
writer.uint32(8).int32(message.dayOffset);
|
|
172
|
+
}
|
|
173
|
+
if (message.temperatureMin !== undefined) {
|
|
174
|
+
writer.uint32(21).float(message.temperatureMin);
|
|
175
|
+
}
|
|
176
|
+
if (message.temperatureMax !== undefined) {
|
|
177
|
+
writer.uint32(29).float(message.temperatureMax);
|
|
178
|
+
}
|
|
179
|
+
if (message.conditionSummary !== "") {
|
|
180
|
+
writer.uint32(34).string(message.conditionSummary);
|
|
181
|
+
}
|
|
182
|
+
if (message.conditionDetail !== "") {
|
|
183
|
+
writer.uint32(42).string(message.conditionDetail);
|
|
184
|
+
}
|
|
185
|
+
if (message.precipitationMm !== undefined) {
|
|
186
|
+
writer.uint32(53).float(message.precipitationMm);
|
|
187
|
+
}
|
|
188
|
+
if (message.windSpeedMs !== undefined) {
|
|
189
|
+
writer.uint32(61).float(message.windSpeedMs);
|
|
190
|
+
}
|
|
191
|
+
if (message.windDirectionText !== undefined) {
|
|
192
|
+
writer.uint32(66).string(message.windDirectionText);
|
|
193
|
+
}
|
|
194
|
+
return writer;
|
|
195
|
+
},
|
|
196
|
+
decode(input, length) {
|
|
197
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
198
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
199
|
+
const message = createBaseWeatherForecastDay();
|
|
200
|
+
while (reader.pos < end) {
|
|
201
|
+
const tag = reader.uint32();
|
|
202
|
+
switch (tag >>> 3) {
|
|
203
|
+
case 1: {
|
|
204
|
+
if (tag !== 8) {
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
message.dayOffset = reader.int32();
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
case 2: {
|
|
211
|
+
if (tag !== 21) {
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
message.temperatureMin = reader.float();
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
case 3: {
|
|
218
|
+
if (tag !== 29) {
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
message.temperatureMax = reader.float();
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
case 4: {
|
|
225
|
+
if (tag !== 34) {
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
message.conditionSummary = reader.string();
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
case 5: {
|
|
232
|
+
if (tag !== 42) {
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
message.conditionDetail = reader.string();
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
case 6: {
|
|
239
|
+
if (tag !== 53) {
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
message.precipitationMm = reader.float();
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
case 7: {
|
|
246
|
+
if (tag !== 61) {
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
message.windSpeedMs = reader.float();
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
case 8: {
|
|
253
|
+
if (tag !== 66) {
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
message.windDirectionText = reader.string();
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
reader.skip(tag & 7);
|
|
264
|
+
}
|
|
265
|
+
return message;
|
|
266
|
+
},
|
|
267
|
+
create(base) {
|
|
268
|
+
return exports.WeatherForecastDay.fromPartial(base ?? {});
|
|
269
|
+
},
|
|
270
|
+
fromPartial(object) {
|
|
271
|
+
const message = createBaseWeatherForecastDay();
|
|
272
|
+
message.dayOffset = object.dayOffset ?? 0;
|
|
273
|
+
message.temperatureMin = object.temperatureMin ?? undefined;
|
|
274
|
+
message.temperatureMax = object.temperatureMax ?? undefined;
|
|
275
|
+
message.conditionSummary = object.conditionSummary ?? "";
|
|
276
|
+
message.conditionDetail = object.conditionDetail ?? "";
|
|
277
|
+
message.precipitationMm = object.precipitationMm ?? undefined;
|
|
278
|
+
message.windSpeedMs = object.windSpeedMs ?? undefined;
|
|
279
|
+
message.windDirectionText = object.windDirectionText ?? undefined;
|
|
280
|
+
return message;
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
function createBaseAgentWeatherUpdate() {
|
|
284
|
+
return { current: undefined, forecast: [] };
|
|
285
|
+
}
|
|
286
|
+
exports.AgentWeatherUpdate = {
|
|
287
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
288
|
+
if (message.current !== undefined) {
|
|
289
|
+
exports.WeatherCurrentData.encode(message.current, writer.uint32(10).fork()).join();
|
|
290
|
+
}
|
|
291
|
+
for (const v of message.forecast) {
|
|
292
|
+
exports.WeatherForecastDay.encode(v, writer.uint32(18).fork()).join();
|
|
293
|
+
}
|
|
294
|
+
return writer;
|
|
295
|
+
},
|
|
296
|
+
decode(input, length) {
|
|
297
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
298
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
299
|
+
const message = createBaseAgentWeatherUpdate();
|
|
300
|
+
while (reader.pos < end) {
|
|
301
|
+
const tag = reader.uint32();
|
|
302
|
+
switch (tag >>> 3) {
|
|
303
|
+
case 1: {
|
|
304
|
+
if (tag !== 10) {
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
message.current = exports.WeatherCurrentData.decode(reader, reader.uint32());
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
310
|
+
case 2: {
|
|
311
|
+
if (tag !== 18) {
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
message.forecast.push(exports.WeatherForecastDay.decode(reader, reader.uint32()));
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
321
|
+
reader.skip(tag & 7);
|
|
322
|
+
}
|
|
323
|
+
return message;
|
|
324
|
+
},
|
|
325
|
+
create(base) {
|
|
326
|
+
return exports.AgentWeatherUpdate.fromPartial(base ?? {});
|
|
327
|
+
},
|
|
328
|
+
fromPartial(object) {
|
|
329
|
+
const message = createBaseAgentWeatherUpdate();
|
|
330
|
+
message.current = (object.current !== undefined && object.current !== null)
|
|
331
|
+
? exports.WeatherCurrentData.fromPartial(object.current)
|
|
332
|
+
: undefined;
|
|
333
|
+
message.forecast = object.forecast?.map((e) => exports.WeatherForecastDay.fromPartial(e)) || [];
|
|
334
|
+
return message;
|
|
335
|
+
},
|
|
336
|
+
};
|
package/package.json
CHANGED