homebridge-nest-accfactory 0.0.4-a
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/CHANGELOG.md +27 -0
- package/LICENSE +176 -0
- package/README.md +121 -0
- package/config.schema.json +107 -0
- package/dist/HomeKitDevice.js +441 -0
- package/dist/HomeKitHistory.js +2835 -0
- package/dist/camera.js +1276 -0
- package/dist/doorbell.js +122 -0
- package/dist/index.js +35 -0
- package/dist/nexustalk.js +741 -0
- package/dist/protect.js +240 -0
- package/dist/protobuf/google/rpc/status.proto +91 -0
- package/dist/protobuf/google/rpc/stream_body.proto +26 -0
- package/dist/protobuf/google/trait/product/camera.proto +53 -0
- package/dist/protobuf/googlehome/foyer.proto +208 -0
- package/dist/protobuf/nest/messages.proto +8 -0
- package/dist/protobuf/nest/services/apigateway.proto +107 -0
- package/dist/protobuf/nest/trait/audio.proto +7 -0
- package/dist/protobuf/nest/trait/cellular.proto +313 -0
- package/dist/protobuf/nest/trait/debug.proto +37 -0
- package/dist/protobuf/nest/trait/detector.proto +41 -0
- package/dist/protobuf/nest/trait/diagnostics.proto +87 -0
- package/dist/protobuf/nest/trait/firmware.proto +221 -0
- package/dist/protobuf/nest/trait/guest.proto +105 -0
- package/dist/protobuf/nest/trait/history.proto +345 -0
- package/dist/protobuf/nest/trait/humanlibrary.proto +19 -0
- package/dist/protobuf/nest/trait/hvac.proto +1353 -0
- package/dist/protobuf/nest/trait/input.proto +29 -0
- package/dist/protobuf/nest/trait/lighting.proto +61 -0
- package/dist/protobuf/nest/trait/located.proto +193 -0
- package/dist/protobuf/nest/trait/media.proto +68 -0
- package/dist/protobuf/nest/trait/network.proto +352 -0
- package/dist/protobuf/nest/trait/occupancy.proto +373 -0
- package/dist/protobuf/nest/trait/olive.proto +15 -0
- package/dist/protobuf/nest/trait/pairing.proto +85 -0
- package/dist/protobuf/nest/trait/product/camera.proto +283 -0
- package/dist/protobuf/nest/trait/product/detect.proto +67 -0
- package/dist/protobuf/nest/trait/product/doorbell.proto +18 -0
- package/dist/protobuf/nest/trait/product/guard.proto +59 -0
- package/dist/protobuf/nest/trait/product/protect.proto +344 -0
- package/dist/protobuf/nest/trait/promonitoring.proto +14 -0
- package/dist/protobuf/nest/trait/resourcedirectory.proto +32 -0
- package/dist/protobuf/nest/trait/safety.proto +119 -0
- package/dist/protobuf/nest/trait/security.proto +516 -0
- package/dist/protobuf/nest/trait/selftest.proto +78 -0
- package/dist/protobuf/nest/trait/sensor.proto +291 -0
- package/dist/protobuf/nest/trait/service.proto +46 -0
- package/dist/protobuf/nest/trait/structure.proto +85 -0
- package/dist/protobuf/nest/trait/system.proto +51 -0
- package/dist/protobuf/nest/trait/test.proto +15 -0
- package/dist/protobuf/nest/trait/ui.proto +65 -0
- package/dist/protobuf/nest/trait/user.proto +98 -0
- package/dist/protobuf/nest/trait/voiceassistant.proto +30 -0
- package/dist/protobuf/nestlabs/eventingapi/v1.proto +83 -0
- package/dist/protobuf/nestlabs/gateway/v1.proto +273 -0
- package/dist/protobuf/nestlabs/gateway/v2.proto +96 -0
- package/dist/protobuf/nestlabs/history/v1.proto +73 -0
- package/dist/protobuf/root.proto +64 -0
- package/dist/protobuf/wdl-event-importance.proto +11 -0
- package/dist/protobuf/wdl.proto +450 -0
- package/dist/protobuf/weave/common.proto +144 -0
- package/dist/protobuf/weave/trait/audio.proto +12 -0
- package/dist/protobuf/weave/trait/auth.proto +22 -0
- package/dist/protobuf/weave/trait/description.proto +32 -0
- package/dist/protobuf/weave/trait/heartbeat.proto +38 -0
- package/dist/protobuf/weave/trait/locale.proto +20 -0
- package/dist/protobuf/weave/trait/network.proto +24 -0
- package/dist/protobuf/weave/trait/pairing.proto +8 -0
- package/dist/protobuf/weave/trait/peerdevices.proto +18 -0
- package/dist/protobuf/weave/trait/power.proto +86 -0
- package/dist/protobuf/weave/trait/schedule.proto +76 -0
- package/dist/protobuf/weave/trait/security.proto +343 -0
- package/dist/protobuf/weave/trait/telemetry/tunnel.proto +37 -0
- package/dist/protobuf/weave/trait/time.proto +16 -0
- package/dist/res/Nest_camera_connecting.h264 +0 -0
- package/dist/res/Nest_camera_connecting.jpg +0 -0
- package/dist/res/Nest_camera_off.h264 +0 -0
- package/dist/res/Nest_camera_off.jpg +0 -0
- package/dist/res/Nest_camera_offline.h264 +0 -0
- package/dist/res/Nest_camera_offline.jpg +0 -0
- package/dist/res/Nest_camera_transfer.jpg +0 -0
- package/dist/streamer.js +344 -0
- package/dist/system.js +3112 -0
- package/dist/tempsensor.js +99 -0
- package/dist/thermostat.js +1026 -0
- package/dist/weather.js +205 -0
- package/dist/webrtc.js +55 -0
- package/package.json +66 -0
package/dist/protect.js
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
// Nest Protect
|
|
2
|
+
// Part of homebridge-nest-accfactory
|
|
3
|
+
//
|
|
4
|
+
// Code version 30/8/2024
|
|
5
|
+
// Mark Hulskamp
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
// Define our modules
|
|
9
|
+
import HomeKitDevice from './HomeKitDevice.js';
|
|
10
|
+
|
|
11
|
+
const LOWBATTERYLEVEL = 10; // Low battery level percentage
|
|
12
|
+
|
|
13
|
+
export default class NestProtect extends HomeKitDevice {
|
|
14
|
+
batteryService = undefined;
|
|
15
|
+
smokeService = undefined;
|
|
16
|
+
motionService = undefined;
|
|
17
|
+
carbonMonoxideService = undefined;
|
|
18
|
+
|
|
19
|
+
constructor(accessory, api, log, eventEmitter, deviceData) {
|
|
20
|
+
super(accessory, api, log, eventEmitter, deviceData);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Class functions
|
|
24
|
+
addServices() {
|
|
25
|
+
// Create extra details for output
|
|
26
|
+
let postSetupDetails = [];
|
|
27
|
+
|
|
28
|
+
// Setup the smoke sensor service if not already present on the accessory
|
|
29
|
+
this.smokeService = this.accessory.getService(this.hap.Service.SmokeSensor);
|
|
30
|
+
if (this.smokeService === undefined) {
|
|
31
|
+
this.smokeService = this.accessory.addService(this.hap.Service.SmokeSensor, '', 1);
|
|
32
|
+
}
|
|
33
|
+
if (this.smokeService.testCharacteristic(this.hap.Characteristic.StatusActive) === false) {
|
|
34
|
+
this.smokeService.addCharacteristic(this.hap.Characteristic.StatusActive);
|
|
35
|
+
}
|
|
36
|
+
if (this.smokeService.testCharacteristic(this.hap.Characteristic.StatusFault) === false) {
|
|
37
|
+
this.smokeService.addCharacteristic(this.hap.Characteristic.StatusFault);
|
|
38
|
+
}
|
|
39
|
+
this.smokeService.setPrimaryService();
|
|
40
|
+
|
|
41
|
+
// Setup the carbon monoxide service if not already present on the accessory
|
|
42
|
+
this.carbonMonoxideService = this.accessory.getService(this.hap.Service.CarbonMonoxideSensor);
|
|
43
|
+
if (this.carbonMonoxideService === undefined) {
|
|
44
|
+
this.carbonMonoxideService = this.accessory.addService(this.hap.Service.CarbonMonoxideSensor, '', 1);
|
|
45
|
+
}
|
|
46
|
+
if (this.carbonMonoxideService.testCharacteristic(this.hap.Characteristic.StatusActive) === false) {
|
|
47
|
+
this.carbonMonoxideService.addCharacteristic(this.hap.Characteristic.StatusActive);
|
|
48
|
+
}
|
|
49
|
+
if (this.carbonMonoxideService.testCharacteristic(this.hap.Characteristic.StatusFault) === false) {
|
|
50
|
+
this.carbonMonoxideService.addCharacteristic(this.hap.Characteristic.StatusFault);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Setup battery service if not already present on the accessory
|
|
54
|
+
this.batteryService = this.accessory.getService(this.hap.Service.Battery);
|
|
55
|
+
if (this.batteryService === undefined) {
|
|
56
|
+
this.batteryService = this.accessory.addService(this.hap.Service.Battery, '', 1);
|
|
57
|
+
}
|
|
58
|
+
this.batteryService.setHiddenService(true);
|
|
59
|
+
|
|
60
|
+
// Setup motion service if not already present on the accessory and Nest protect is a wired version
|
|
61
|
+
if (typeof this.deviceData?.wired_or_battery === 'number' && this.deviceData?.wired_or_battery === 0) {
|
|
62
|
+
this.motionService = this.accessory.getService(this.hap.Service.MotionSensor);
|
|
63
|
+
if (this.motionService === undefined) {
|
|
64
|
+
this.motionService = this.accessory.addService(this.hap.Service.MotionSensor, '', 1);
|
|
65
|
+
}
|
|
66
|
+
postSetupDetails.push('With motion sensor');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Setup linkage to EveHome app if configured todo so
|
|
70
|
+
if (
|
|
71
|
+
this.deviceData?.eveHistory === true &&
|
|
72
|
+
this.smokeService !== undefined &&
|
|
73
|
+
typeof this.historyService?.linkToEveHome === 'function'
|
|
74
|
+
) {
|
|
75
|
+
this.historyService.linkToEveHome(this.smokeService, {
|
|
76
|
+
description: this.deviceData.description,
|
|
77
|
+
getcommand: this.#EveHomeGetcommand.bind(this),
|
|
78
|
+
setcommand: this.#EveHomeSetcommand.bind(this),
|
|
79
|
+
EveSmoke_lastalarmtest: this.deviceData.latest_alarm_test,
|
|
80
|
+
EveSmoke_alarmtest: this.deviceData.self_test_in_progress,
|
|
81
|
+
EveSmoke_heatstatus: this.deviceData.heat_status,
|
|
82
|
+
EveSmoke_hushedstate: this.deviceData.hushed_state,
|
|
83
|
+
EveSmoke_statusled: this.deviceData.ntp_green_led,
|
|
84
|
+
EveSmoke_smoketestpassed: this.deviceData.smoke_test_passed,
|
|
85
|
+
EveSmoke_heattestpassed: this.deviceData.heat_test_passed,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return postSetupDetails;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
updateServices(deviceData) {
|
|
93
|
+
if (
|
|
94
|
+
typeof deviceData !== 'object' ||
|
|
95
|
+
this.smokeService === undefined ||
|
|
96
|
+
this.carbonMonoxideService === undefined ||
|
|
97
|
+
this.batteryService === undefined
|
|
98
|
+
) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Update battery level and status
|
|
103
|
+
this.batteryService.updateCharacteristic(this.hap.Characteristic.BatteryLevel, deviceData.battery_level);
|
|
104
|
+
this.batteryService.updateCharacteristic(
|
|
105
|
+
this.hap.Characteristic.StatusLowBattery,
|
|
106
|
+
deviceData.battery_level > LOWBATTERYLEVEL && deviceData.battery_health_state === 0
|
|
107
|
+
? this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL
|
|
108
|
+
: this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW,
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
// Update smoke details
|
|
112
|
+
// If Nest isn't online or removed from base, report in HomeKit
|
|
113
|
+
this.smokeService.updateCharacteristic(
|
|
114
|
+
this.hap.Characteristic.StatusActive,
|
|
115
|
+
deviceData.online === true && deviceData.removed_from_base === false,
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
// General fault if replacement date past or Nest isn't online or removed from base
|
|
119
|
+
this.smokeService.updateCharacteristic(
|
|
120
|
+
this.hap.Characteristic.StatusFault,
|
|
121
|
+
deviceData.online === true && deviceData.removed_from_base === false && Math.floor(Date.now() / 1000) <= deviceData.replacement_date
|
|
122
|
+
? this.hap.Characteristic.StatusFault.NO_FAULT
|
|
123
|
+
: this.hap.Characteristic.StatusFault.GENERAL_FAULT,
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
this.smokeService.updateCharacteristic(
|
|
127
|
+
this.hap.Characteristic.SmokeDetected,
|
|
128
|
+
deviceData.smoke_status === 2
|
|
129
|
+
? this.hap.Characteristic.SmokeDetected.SMOKE_DETECTED
|
|
130
|
+
: this.hap.Characteristic.SmokeDetected.SMOKE_NOT_DETECTED,
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
if (deviceData.smoke_status !== 0 && this.deviceData.smoke_status === 0) {
|
|
134
|
+
this?.log?.warn && this.log.warn('Smoke detected in "%s"', this.deviceData.description);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (deviceData.smoke_status === 0 && this.deviceData.smoke_status !== 0) {
|
|
138
|
+
this?.log?.info && this.log.info('Smoke is nolonger detected in "%s"', this.deviceData.description);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Update carbon monoxide details
|
|
142
|
+
// If Nest isn't online or removed from base, report in HomeKit
|
|
143
|
+
this.carbonMonoxideService.updateCharacteristic(
|
|
144
|
+
this.hap.Characteristic.StatusActive,
|
|
145
|
+
deviceData.online === true && deviceData.removed_from_base === false,
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
// General fault if replacement date past or Nest isn't online or removed from base
|
|
149
|
+
this.carbonMonoxideService.updateCharacteristic(
|
|
150
|
+
this.hap.Characteristic.StatusFault,
|
|
151
|
+
deviceData.online === true && deviceData.removed_from_base === false && Math.floor(Date.now() / 1000) <= deviceData.replacement_date
|
|
152
|
+
? this.hap.Characteristic.StatusFault.NO_FAULT
|
|
153
|
+
: this.hap.Characteristic.StatusFault.GENERAL_FAULT,
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
this.carbonMonoxideService.updateCharacteristic(
|
|
157
|
+
this.hap.Characteristic.CarbonMonoxideDetected,
|
|
158
|
+
deviceData.co_status === 2
|
|
159
|
+
? this.hap.Characteristic.CarbonMonoxideDetected.CO_LEVELS_ABNORMAL
|
|
160
|
+
: this.hap.Characteristic.CarbonMonoxideDetected.CO_LEVELS_NORMAL,
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
if (deviceData.co_status !== 0 && this.deviceData.co_status === 0) {
|
|
164
|
+
this?.log?.warn && this.log.warn('Abnormal carbon monoxide levels detected in "%s"', this.deviceData.description);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (deviceData.co_status === 0 && this.deviceData.co_status !== 0) {
|
|
168
|
+
this?.log?.info && this.log.info('Carbon monoxide levels have returned to normal in "%s"', this.deviceData.description);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Update motion service if present
|
|
172
|
+
if (this.motionService !== undefined) {
|
|
173
|
+
// Motion detect if auto_away = false. Not supported on battery powered Nest Protects
|
|
174
|
+
// If Nest isn't online or removed from base, report in HomeKit
|
|
175
|
+
this.motionService.updateCharacteristic(
|
|
176
|
+
this.hap.Characteristic.StatusActive,
|
|
177
|
+
deviceData.online === true && deviceData.removed_from_base === false,
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
// General fault if replacement date past or Nest isn't online or removed from base
|
|
181
|
+
this.motionService.updateCharacteristic(
|
|
182
|
+
this.hap.Characteristic.StatusFault,
|
|
183
|
+
deviceData.online === true && deviceData.removed_from_base === false && Math.floor(Date.now() / 1000) <= deviceData.replacement_date
|
|
184
|
+
? this.hap.Characteristic.StatusFault.NO_FAULT
|
|
185
|
+
: this.hap.Characteristic.StatusFault.GENERAL_FAULT,
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
this.motionService.updateCharacteristic(this.hap.Characteristic.MotionDetected, deviceData.detected_motion === false);
|
|
189
|
+
|
|
190
|
+
// Log motion to history only if changed to previous recording
|
|
191
|
+
if (deviceData.detected_motion !== this.deviceData.detected_motion && typeof this.historyService?.addHistory === 'function') {
|
|
192
|
+
this.historyService.addHistory(this.motionService, {
|
|
193
|
+
time: Math.floor(Date.now() / 1000),
|
|
194
|
+
status: deviceData.detected_motion === true ? 1 : 0,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Notify Eve App of device status changes if linked
|
|
200
|
+
if (this.deviceData.eveHistory === true && typeof this.historyService?.updateEveHome === 'function') {
|
|
201
|
+
// Update our internal data with properties Eve will need to process
|
|
202
|
+
this.deviceData.latest_alarm_test = deviceData.latest_alarm_test;
|
|
203
|
+
this.deviceData.self_test_in_progress = deviceData.self_test_in_progress;
|
|
204
|
+
this.deviceData.heat_status = deviceData.heat_status;
|
|
205
|
+
this.deviceData.ntp_green_led = deviceData.ntp_green_led;
|
|
206
|
+
this.deviceData.smoke_test_passed = deviceData.smoke_test_passed;
|
|
207
|
+
this.deviceData.heat_test_passed = deviceData.heat_test_passed;
|
|
208
|
+
this.historyService.updateEveHome(this.smokeService, this.#EveHomeGetcommand.bind(this));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
#EveHomeGetcommand(EveHomeGetData) {
|
|
213
|
+
// Pass back extra data for Eve Smoke this.hap.CharacteristicEventTypes.GET process command
|
|
214
|
+
// Data will already be an object, our only job is to add/modify to it
|
|
215
|
+
if (typeof EveHomeGetData === 'object') {
|
|
216
|
+
EveHomeGetData.lastalarmtest = this.deviceData.latest_alarm_test;
|
|
217
|
+
EveHomeGetData.alarmtest = this.deviceData.self_test_in_progress;
|
|
218
|
+
EveHomeGetData.heatstatus = this.deviceData.heat_status;
|
|
219
|
+
EveHomeGetData.statusled = this.deviceData.ntp_green_led;
|
|
220
|
+
EveHomeGetData.smoketestpassed = this.deviceData.smoke_test_passed;
|
|
221
|
+
EveHomeGetData.heattestpassed = this.deviceData.heat_test_passed;
|
|
222
|
+
EveHomeGetData.hushedstate = this.deviceData.hushed_state;
|
|
223
|
+
}
|
|
224
|
+
return EveHomeGetData;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
#EveHomeSetcommand(EveHomeSetData) {
|
|
228
|
+
if (typeof EveHomeSetData !== 'object') {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (typeof EveHomeSetData?.alarmtest === 'boolean') {
|
|
233
|
+
//this.log.info('Eve Smoke Alarm test', (EveHomeSetData.alarmtest === true ? 'start' : 'stop'));
|
|
234
|
+
}
|
|
235
|
+
if (typeof EveHomeSetData?.statusled === 'boolean') {
|
|
236
|
+
this.deviceData.ntp_green_led = EveHomeSetData.statusled; // Do quick status update as setting Nest values does take sometime
|
|
237
|
+
this.set({ ntp_green_led_enable: EveHomeSetData.statusled });
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Copyright 2017 Google Inc.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.rpc;
|
|
18
|
+
|
|
19
|
+
import "google/protobuf/any.proto";
|
|
20
|
+
|
|
21
|
+
option go_package = "google.golang.org/genproto/googleapis/rpc/status;status";
|
|
22
|
+
option java_multiple_files = true;
|
|
23
|
+
option java_outer_classname = "StatusProto";
|
|
24
|
+
option java_package = "com.google.rpc";
|
|
25
|
+
option objc_class_prefix = "RPC";
|
|
26
|
+
|
|
27
|
+
// The `Status` type defines a logical error model that is suitable for different
|
|
28
|
+
// programming environments, including REST APIs and RPC APIs. It is used by
|
|
29
|
+
// [gRPC](https://github.com/grpc). The error model is designed to be:
|
|
30
|
+
//
|
|
31
|
+
// - Simple to use and understand for most users
|
|
32
|
+
// - Flexible enough to meet unexpected needs
|
|
33
|
+
//
|
|
34
|
+
// # Overview
|
|
35
|
+
//
|
|
36
|
+
// The `Status` message contains three pieces of data: error code, error message,
|
|
37
|
+
// and error details. The error code should be an enum value of
|
|
38
|
+
// [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The
|
|
39
|
+
// error message should be a developer-facing English message that helps
|
|
40
|
+
// developers *understand* and *resolve* the error. If a localized user-facing
|
|
41
|
+
// error message is needed, put the localized message in the error details or
|
|
42
|
+
// localize it in the client. The optional error details may contain arbitrary
|
|
43
|
+
// information about the error. There is a predefined set of error detail types
|
|
44
|
+
// in the package `google.rpc` that can be used for common error conditions.
|
|
45
|
+
//
|
|
46
|
+
// # Language mapping
|
|
47
|
+
//
|
|
48
|
+
// The `Status` message is the logical representation of the error model, but it
|
|
49
|
+
// is not necessarily the actual wire format. When the `Status` message is
|
|
50
|
+
// exposed in different client libraries and different wire protocols, it can be
|
|
51
|
+
// mapped differently. For example, it will likely be mapped to some exceptions
|
|
52
|
+
// in Java, but more likely mapped to some error codes in C.
|
|
53
|
+
//
|
|
54
|
+
// # Other uses
|
|
55
|
+
//
|
|
56
|
+
// The error model and the `Status` message can be used in a variety of
|
|
57
|
+
// environments, either with or without APIs, to provide a
|
|
58
|
+
// consistent developer experience across different environments.
|
|
59
|
+
//
|
|
60
|
+
// Example uses of this error model include:
|
|
61
|
+
//
|
|
62
|
+
// - Partial errors. If a service needs to return partial errors to the client,
|
|
63
|
+
// it may embed the `Status` in the normal response to indicate the partial
|
|
64
|
+
// errors.
|
|
65
|
+
//
|
|
66
|
+
// - Workflow errors. A typical workflow has multiple steps. Each step may
|
|
67
|
+
// have a `Status` message for error reporting.
|
|
68
|
+
//
|
|
69
|
+
// - Batch operations. If a client uses batch request and batch response, the
|
|
70
|
+
// `Status` message should be used directly inside batch response, one for
|
|
71
|
+
// each error sub-response.
|
|
72
|
+
//
|
|
73
|
+
// - Asynchronous operations. If an API call embeds asynchronous operation
|
|
74
|
+
// results in its response, the status of those operations should be
|
|
75
|
+
// represented directly using the `Status` message.
|
|
76
|
+
//
|
|
77
|
+
// - Logging. If some API errors are stored in logs, the message `Status` could
|
|
78
|
+
// be used directly after any stripping needed for security/privacy reasons.
|
|
79
|
+
message Status {
|
|
80
|
+
// The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
|
|
81
|
+
int32 code = 1;
|
|
82
|
+
|
|
83
|
+
// A developer-facing error message, which should be in English. Any
|
|
84
|
+
// user-facing error message should be localized and sent in the
|
|
85
|
+
// [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
|
|
86
|
+
string message = 2;
|
|
87
|
+
|
|
88
|
+
// A list of messages that carry the error details. There is a common set of
|
|
89
|
+
// message types for APIs to use.
|
|
90
|
+
repeated google.protobuf.Any details = 3;
|
|
91
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright 2018 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.rpc;
|
|
18
|
+
|
|
19
|
+
import "../../google/rpc/status.proto";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
message StreamBody {
|
|
23
|
+
repeated bytes message = 1;
|
|
24
|
+
google.rpc.Status status = 2;
|
|
25
|
+
repeated bytes noop = 15;
|
|
26
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
import "google/protobuf/duration.proto";
|
|
4
|
+
import "google/protobuf/wrappers.proto";
|
|
5
|
+
|
|
6
|
+
package google.trait.product.camera;
|
|
7
|
+
|
|
8
|
+
message FloodlightStateTrait {
|
|
9
|
+
enum LightState {
|
|
10
|
+
LIGHT_STATE_UNSPECIFIED = 0;
|
|
11
|
+
LIGHT_STATE_OFF = 1;
|
|
12
|
+
LIGHT_STATE_ON = 2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
LightState triggeredByMotion = 1;
|
|
16
|
+
LightState triggeredByEvent = 2;
|
|
17
|
+
LightState triggeredByLiveView = 3;
|
|
18
|
+
LightState manuallyTriggered = 4;
|
|
19
|
+
string associatedFloodlightSerialNumber = 5;
|
|
20
|
+
string associatedFloodlightFirmwareVersion = 6;
|
|
21
|
+
LightState currentState = 7;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message FloodlightSettingsTrait {
|
|
25
|
+
enum MotionTrigger {
|
|
26
|
+
TRIGGER_UNSPECIFIED = 0;
|
|
27
|
+
TRIGGER_SENSITIVITY_LOW = 1;
|
|
28
|
+
TRIGGER_SENSITIVITY_MEDIUM = 2;
|
|
29
|
+
TRIGGER_SENSITIVITY_HIGH = 3;
|
|
30
|
+
TRIGGER_SENSITIVITY_OFF = 4;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
enum OnOffTrigger {
|
|
34
|
+
TRIGGER_UNSPECIFIED = 0;
|
|
35
|
+
TRIGGER_OFF = 1;
|
|
36
|
+
TRIGGER_ON = 2;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
enum DaylightSensitivity {
|
|
40
|
+
DAYLIGHT_SENSITIVITY_UNSPECIFIED = 0;
|
|
41
|
+
DAYLIGHT_SENSITIVITY_DARKER = 1;
|
|
42
|
+
DAYLIGHT_SENSITIVITY_MEDIUM = 2;
|
|
43
|
+
DAYLIGHT_SENSITIVITY_BRIGHTER = 3;
|
|
44
|
+
DAYLIGHT_SENSITIVITY_DARKEST = 4;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
int32 brightness = 1;
|
|
48
|
+
MotionTrigger motionTrigger = 2;
|
|
49
|
+
google.protobuf.Duration timerDuration = 3;
|
|
50
|
+
OnOffTrigger liveViewingTrigger = 4;
|
|
51
|
+
DaylightSensitivity daylightSensitivity = 5;
|
|
52
|
+
OnOffTrigger cameraEventTrigger = 6;
|
|
53
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package google.internal.home.foyer.v1;
|
|
4
|
+
|
|
5
|
+
message StructuresService {
|
|
6
|
+
message GetHomeGraphRequest {
|
|
7
|
+
enum DefaultHiddenDeviceType {
|
|
8
|
+
DEVICE_TYPE_UNKNOWN = 0;
|
|
9
|
+
DEVICE_TYPE_TOPAZ = 1;
|
|
10
|
+
DEVICE_TYPE_KRYPTONITE = 2;
|
|
11
|
+
DEVICE_TYPE_ANTIGUA = 3;
|
|
12
|
+
DEVICE_TYPE_NEST_TAG = 4;
|
|
13
|
+
DEVICE_TYPE_NEST_HEATLINK = 5;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
string requestId = 3; // 64 hex characters - random is OK
|
|
17
|
+
int32 unknown1 = 4; // always 1?
|
|
18
|
+
int32 unknown2 = 5; // always 1?
|
|
19
|
+
repeated DefaultHiddenDeviceType deviceTypesToUnhideArray = 10;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message GetHomeGraphResponse {
|
|
23
|
+
uint64 responseTimestamp = 1; // Epoch in ms for this response
|
|
24
|
+
repeated Home homes = 2;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message Home {
|
|
28
|
+
string uuid = 1;
|
|
29
|
+
string name = 2;
|
|
30
|
+
Address address = 3;
|
|
31
|
+
EmailAddress emailAddress = 4;
|
|
32
|
+
repeated Room rooms = 6;
|
|
33
|
+
repeated Device devices = 7;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message Address {
|
|
37
|
+
string line1 = 1;
|
|
38
|
+
string line2 = 2;
|
|
39
|
+
uint64 timeCreated = 5;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message EmailAddress {
|
|
43
|
+
string value = 1;
|
|
44
|
+
// field #4 has an unknown varint (1)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message Room {
|
|
48
|
+
string uuid = 1;
|
|
49
|
+
string name = 3;
|
|
50
|
+
google.protobuf.StringValue type = 4;
|
|
51
|
+
repeated Device devices = 5;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
message Device {
|
|
55
|
+
message Id {
|
|
56
|
+
string googleUuid = 1;
|
|
57
|
+
ThirdPartyId thirdPartyId = 2;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message ThirdPartyId {
|
|
61
|
+
string idType = 1;
|
|
62
|
+
string id = 2;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
message OtherThirdPartyIds {
|
|
66
|
+
repeated ThirdPartyId otherThirdPartyId = 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
Id id = 1;
|
|
70
|
+
OtherThirdPartyIds otherIds = 39;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
message CameraService {
|
|
75
|
+
message SendTalkbackRequest {
|
|
76
|
+
enum TalkbackCommand {
|
|
77
|
+
COMMAND_UNSPECIFIED = 0;
|
|
78
|
+
COMMAND_START = 1;
|
|
79
|
+
COMMAND_STOP = 2;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
google.protobuf.StringValue googleDeviceId = 1;
|
|
83
|
+
string streamId = 2;
|
|
84
|
+
TalkbackCommand command = 3;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message SendTalkbackResponse {
|
|
88
|
+
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
message SendCameraViewIntentRequest {
|
|
92
|
+
enum ViewIntentCommand {
|
|
93
|
+
VIEW_INTENT_UNSPECIFIED = 0;
|
|
94
|
+
VIEW_INTENT_START = 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
message ViewIntentRequest {
|
|
98
|
+
google.protobuf.StringValue googleDeviceId = 1;
|
|
99
|
+
ViewIntentCommand command = 2;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
ViewIntentRequest request = 1;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
message SendCameraViewIntentResponse {
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
message JoinStreamRequest {
|
|
110
|
+
enum JoinStreamRequest_StreamContext {
|
|
111
|
+
STREAM_CONTEXT_UNSPECIFIED = 0;
|
|
112
|
+
STREAM_CONTEXT_DEFAULT = 1;
|
|
113
|
+
STREAM_CONTEXT_SETUP = 2;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
enum JoinStreamRequest_EndStreamReason {
|
|
117
|
+
REASON_UNSPECIFIED = 0;
|
|
118
|
+
REASON_UNKNOWN = 1;
|
|
119
|
+
REASON_USER_EXITED_SESSION = 2;
|
|
120
|
+
REASON_VIDEO_TIME_OUT = 3;
|
|
121
|
+
REASON_AUDIO_TIME_OUT = 4;
|
|
122
|
+
REASON_NETWORK_FAILURE = 5;
|
|
123
|
+
REASON_INCOMPATIBLE_VIDEO_CODEC = 6;
|
|
124
|
+
REASON_AUDIO_ENCODE_ERROR = 7;
|
|
125
|
+
REASON_AUDIO_DECODE_ERROR = 8;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
enum JoinStreamRequest_VideoResolution {
|
|
129
|
+
VIDEO_RESOLUTION_UNSPECIFIED = 0;
|
|
130
|
+
VIDEO_RESOLUTION_STANDARD = 1;
|
|
131
|
+
VIDEO_RESOLUTION_FULL_HIGH = 2;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
string sdp = 1;
|
|
135
|
+
string deviceId = 2;
|
|
136
|
+
string command = 3;
|
|
137
|
+
string streamId = 4;
|
|
138
|
+
bool local = 5;
|
|
139
|
+
JoinStreamRequest_StreamContext streamContext = 6;
|
|
140
|
+
JoinStreamRequest_EndStreamReason endStreamReason = 7;
|
|
141
|
+
JoinStreamRequest_VideoResolution requestedVideoResolution = 8;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
message JoinStreamResponse {
|
|
145
|
+
enum StreamTerminationStatus {
|
|
146
|
+
STATUS_UNSPECIFIED = 0;
|
|
147
|
+
STATUS_STREAM_TERMINATED = 1;
|
|
148
|
+
STATUS_STREAM_NOT_TERMINATED = 2; // e.g. invalid stream ID specified
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
enum StreamExtensionStatus {
|
|
152
|
+
STATUS_UNSPECIFIED = 0;
|
|
153
|
+
STATUS_STREAM_EXTENDED = 1;
|
|
154
|
+
STATUS_STREAM_NOT_EXTENDED = 2; // e.g. invalid stream ID specified
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
string sdp = 1;
|
|
158
|
+
string responseType = 2;
|
|
159
|
+
string streamId = 3;
|
|
160
|
+
StreamTerminationStatus streamTerminationStatus = 4;
|
|
161
|
+
StreamExtensionStatus streamExtensionStatus = 5;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
message HomeControlService {
|
|
166
|
+
message UpdateTraitsRequest {
|
|
167
|
+
message Request {
|
|
168
|
+
TargetDevice device = 1;
|
|
169
|
+
TraitToUpdate trait = 2;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
message TargetDevice {
|
|
173
|
+
string googleDeviceId = 1;
|
|
174
|
+
google.protobuf.StringValue service = 2;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
message TraitToUpdate {
|
|
178
|
+
string category = 1;
|
|
179
|
+
UpdateTrait updateTrait = 2;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
message UpdateTrait {
|
|
183
|
+
string name = 1;
|
|
184
|
+
TraitValue value = 2;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
message TraitValue {
|
|
188
|
+
string string = 3;
|
|
189
|
+
int32 intValue = 4;
|
|
190
|
+
Properties properties = 5;
|
|
191
|
+
PropertyArray array = 6;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
message PropertyArray {
|
|
195
|
+
repeated TraitValue values = 1;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
message Properties {
|
|
199
|
+
repeated UpdateTrait properties = 1;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
Request request = 1;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
message UpdateTraitsResponse {
|
|
206
|
+
|
|
207
|
+
}
|
|
208
|
+
}
|