homebridge-nest-accfactory 0.0.4-a → 0.0.5

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/protect.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Nest Protect
2
2
  // Part of homebridge-nest-accfactory
3
3
  //
4
- // Code version 30/8/2024
4
+ // Code version 12/9/2024
5
5
  // Mark Hulskamp
6
6
  'use strict';
7
7
 
@@ -80,7 +80,7 @@ export default class NestProtect extends HomeKitDevice {
80
80
  EveSmoke_alarmtest: this.deviceData.self_test_in_progress,
81
81
  EveSmoke_heatstatus: this.deviceData.heat_status,
82
82
  EveSmoke_hushedstate: this.deviceData.hushed_state,
83
- EveSmoke_statusled: this.deviceData.ntp_green_led,
83
+ EveSmoke_statusled: this.deviceData.ntp_green_led_enable,
84
84
  EveSmoke_smoketestpassed: this.deviceData.smoke_test_passed,
85
85
  EveSmoke_heattestpassed: this.deviceData.heat_test_passed,
86
86
  });
@@ -131,11 +131,11 @@ export default class NestProtect extends HomeKitDevice {
131
131
  );
132
132
 
133
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);
134
+ this?.log?.warn && this.log.warn('Smoke detected in "%s"', deviceData.description);
135
135
  }
136
136
 
137
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);
138
+ this?.log?.info && this.log.info('Smoke is nolonger detected in "%s"', deviceData.description);
139
139
  }
140
140
 
141
141
  // Update carbon monoxide details
@@ -161,11 +161,11 @@ export default class NestProtect extends HomeKitDevice {
161
161
  );
162
162
 
163
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);
164
+ this?.log?.warn && this.log.warn('Abnormal carbon monoxide levels detected in "%s"', deviceData.description);
165
165
  }
166
166
 
167
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);
168
+ this?.log?.info && this.log.info('Carbon monoxide levels have returned to normal in "%s"', deviceData.description);
169
169
  }
170
170
 
171
171
  // Update motion service if present
@@ -202,7 +202,7 @@ export default class NestProtect extends HomeKitDevice {
202
202
  this.deviceData.latest_alarm_test = deviceData.latest_alarm_test;
203
203
  this.deviceData.self_test_in_progress = deviceData.self_test_in_progress;
204
204
  this.deviceData.heat_status = deviceData.heat_status;
205
- this.deviceData.ntp_green_led = deviceData.ntp_green_led;
205
+ this.deviceData.ntp_green_led_enable = deviceData.ntp_green_led_enable;
206
206
  this.deviceData.smoke_test_passed = deviceData.smoke_test_passed;
207
207
  this.deviceData.heat_test_passed = deviceData.heat_test_passed;
208
208
  this.historyService.updateEveHome(this.smokeService, this.#EveHomeGetcommand.bind(this));
@@ -216,7 +216,7 @@ export default class NestProtect extends HomeKitDevice {
216
216
  EveHomeGetData.lastalarmtest = this.deviceData.latest_alarm_test;
217
217
  EveHomeGetData.alarmtest = this.deviceData.self_test_in_progress;
218
218
  EveHomeGetData.heatstatus = this.deviceData.heat_status;
219
- EveHomeGetData.statusled = this.deviceData.ntp_green_led;
219
+ EveHomeGetData.statusled = this.deviceData.ntp_green_led_enable;
220
220
  EveHomeGetData.smoketestpassed = this.deviceData.smoke_test_passed;
221
221
  EveHomeGetData.heattestpassed = this.deviceData.heat_test_passed;
222
222
  EveHomeGetData.hushedstate = this.deviceData.hushed_state;
@@ -233,7 +233,6 @@ export default class NestProtect extends HomeKitDevice {
233
233
  //this.log.info('Eve Smoke Alarm test', (EveHomeSetData.alarmtest === true ? 'start' : 'stop'));
234
234
  }
235
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
236
  this.set({ ntp_green_led_enable: EveHomeSetData.statusled });
238
237
  }
239
238
  }
@@ -50,4 +50,5 @@ message FloodlightSettingsTrait {
50
50
  OnOffTrigger liveViewingTrigger = 4;
51
51
  DaylightSensitivity daylightSensitivity = 5;
52
52
  OnOffTrigger cameraEventTrigger = 6;
53
+ uin32 lightState = 7;
53
54
  }
@@ -28,15 +28,20 @@ message StructuresService {
28
28
  string uuid = 1;
29
29
  string name = 2;
30
30
  Address address = 3;
31
- EmailAddress emailAddress = 4;
31
+ repeated EmailAddress linked_users = 4;
32
32
  repeated Room rooms = 6;
33
33
  repeated Device devices = 7;
34
34
  }
35
35
 
36
36
  message Address {
37
37
  string line1 = 1;
38
- string line2 = 2;
38
+ message Coordinates {
39
+ double latitude = 1;
40
+ double longitude = 2;
41
+ }
42
+ Coordinates coordinates = 2;
39
43
  uint64 timeCreated = 5;
44
+ string timezone = 6;
40
45
  }
41
46
 
42
47
  message EmailAddress {
@@ -47,7 +52,10 @@ message StructuresService {
47
52
  message Room {
48
53
  string uuid = 1;
49
54
  string name = 3;
50
- google.protobuf.StringValue type = 4;
55
+ message Category {
56
+ string name = 1;
57
+ }
58
+ Category category = 4;
51
59
  repeated Device devices = 5;
52
60
  }
53
61
 
@@ -0,0 +1,181 @@
1
+ syntax = "proto3";
2
+
3
+ package nest.nexustalk.v1;
4
+
5
+ enum Profile {
6
+ AVPROFILE_MOBILE_1 = 1;
7
+ AVPROFILE_HD_MAIN_1 = 2;
8
+ AUDIO_AAC = 3;
9
+ AUDIO_SPEEX = 4;
10
+ AUDIO_OPUS = 5;
11
+ VIDEO_H264_50KBIT_L12 = 6;
12
+ VIDEO_H264_530KBIT_L31 = 7;
13
+ VIDEO_H264_100KBIT_L30 = 8;
14
+ VIDEO_H264_2MBIT_L40 = 9;
15
+ VIDEO_H264_50KBIT_L12_THUMBNAIL = 10;
16
+ META = 11;
17
+ DIRECTORS_CUT = 12;
18
+ AUDIO_OPUS_LIVE = 13;
19
+ VIDEO_H264_L31 = 14;
20
+ VIDEO_H264_L40 = 15;
21
+ }
22
+
23
+ message Hello {
24
+ enum ProtocolVersion {
25
+ VERSION_1 = 1;
26
+ VERSION_2 = 2;
27
+ VERSION_3 = 3;
28
+ }
29
+
30
+ enum ClientType {
31
+ ANDROID = 1;
32
+ IOS = 2;
33
+ WEB = 3;
34
+ }
35
+
36
+ ProtocolVersion protocolVersion = 1;
37
+ string uuid = 2;
38
+ bool requireConnectedCamera = 3;
39
+ string sessionToken = 4;
40
+ bool isCamera = 5;
41
+ string deviceId = 6;
42
+ string userAgent = 7;
43
+ string serviceAccessKey = 8;
44
+ ClientType clientType = 9;
45
+ string wwnAccessToken = 10;
46
+ string encryptedDeviceId = 11;
47
+ bytes authoriseRequest = 12;
48
+ string clientIpAddress = 13;
49
+ bool requireOwnerServer = 15;
50
+ }
51
+
52
+ message AuthoriseRequest {
53
+ string sessionToken = 1;
54
+ string wwnAccessToken = 2;
55
+ string serviceAccessKey = 3;
56
+ string oliveToken = 4;
57
+ }
58
+
59
+ message Redirect {
60
+ string newHost = 1;
61
+ bool isTranscode = 2;
62
+ }
63
+
64
+ message Ok {
65
+ uint32 udpPort = 1;
66
+ }
67
+
68
+ message PlaybackPacket {
69
+ message DirectorsCutRegions {
70
+ uint32 id = 1;
71
+ uint32 left = 2;
72
+ uint32 right = 3;
73
+ uint32 top = 4;
74
+ uint32 bottom = 5;
75
+ }
76
+ uint32 sessionId = 1;
77
+ uint32 channelId = 2;
78
+ sint32 timestampDelta = 3;
79
+ bytes payload = 4;
80
+ uint64 latencyRtpSequence = 5;
81
+ uint64 latencyRtpSsrc = 6;
82
+ repeated DirectorsCutRegions directorsCutRegions = 7;
83
+ }
84
+
85
+ message PlaybackEnd {
86
+ enum Reason {
87
+ USER_ENDED_SESSION = 0;
88
+ ERROR_TIME_NOT_AVAILABLE = 1;
89
+ ERROR_PROFILE_NOT_AVAILABLE = 2;
90
+ ERROR_TRANSCODE_NOT_AVAILABLE = 3;
91
+ ERROR_LEAF_NODE_CANNOT_REACH_CAMERA = 4;
92
+ PLAY_END_SESSION_COMPLETE = 128;
93
+ }
94
+
95
+ uint32 sessionId = 1;
96
+ Reason reason = 2;
97
+ }
98
+
99
+ message PlaybackBegin {
100
+ enum CodecType {
101
+ SPEEX = 0;
102
+ PCM_S16_LE = 1;
103
+ H264 = 2;
104
+ AAC = 3;
105
+ OPUS = 4;
106
+ META = 5;
107
+ DIRECTORS_CUT = 6;
108
+ }
109
+
110
+ message Channels {
111
+ uint32 channelId = 1;
112
+ CodecType codecType = 2;
113
+ uint32 sampleRate = 3;
114
+ bytes privateData = 4;
115
+ double startTime = 5;
116
+ double rtpStartTime = 6;
117
+ uint32 udpSsrc = 7;
118
+ Profile profile = 8;
119
+ }
120
+ uint32 sessionId = 1;
121
+ repeated Channels channels = 2;
122
+ bytes srtpMasterKey = 3;
123
+ bytes srtpMasterSalt = 4;
124
+ uint32 fecKVal = 5;
125
+ uint32 fecNVal = 7;
126
+ }
127
+
128
+ message Error {
129
+ enum ErrorCode {
130
+ ERROR_CAMERA_NOT_CONNECTED = 1;
131
+ ERROR_ILLEGAL_PACKET = 2;
132
+ ERROR_AUTHORIZATION_FAILED = 3;
133
+ ERROR_NO_TRANSCODER_AVAILABLE = 4;
134
+ ERROR_TRANSCODE_PROXY_ERROR = 5;
135
+ ERROR_INTERNAL = 6;
136
+ }
137
+
138
+ ErrorCode code = 1;
139
+ string message = 2;
140
+ }
141
+
142
+ message TalkbackBegin {
143
+ string userId = 1;
144
+ uint32 sessionId = 2;
145
+ uint32 quickActionId = 3;
146
+ string deviceId = 4;
147
+ }
148
+
149
+ message TalkbackEnd {
150
+ string userId = 1;
151
+ uint32 sessionId = 2;
152
+ uint32 quickActionId = 3;
153
+ string deviceId = 4;
154
+ }
155
+
156
+ message StartPlayback {
157
+ enum ProfileNotFoundAction {
158
+ REDIRECT = 0;
159
+ USE_NEXT_AVAILABLE = 1;
160
+ }
161
+
162
+ uint32 sessionId = 1;
163
+ Profile profile = 2;
164
+ double startTime = 3;
165
+ bytes externalIp = 4;
166
+ uint32 externalPort = 5;
167
+ repeated Profile otherProfiles = 6;
168
+ ProfileNotFoundAction profileNotFoundAction = 7;
169
+ }
170
+
171
+ message StopPlayback {
172
+ uint32 sessionId = 1;
173
+ }
174
+
175
+ message AudioPayload {
176
+ bytes payload = 1;
177
+ uint32 sessionId = 2;
178
+ CodecType codec = 3;
179
+ uint32 sampleRate = 4;
180
+ uint32 latencyMeasureTag = 5;
181
+ }
@@ -3,12 +3,16 @@ syntax = "proto3";
3
3
  import "google/protobuf/any.proto";
4
4
  import "google/protobuf/duration.proto";
5
5
  import "google/protobuf/timestamp.proto";
6
- import "../../nest/messages.proto";
7
6
  import "../../weave/common.proto";
8
7
  import "../../wdl-event-importance.proto";
9
8
 
10
9
  package nestlabs.eventingapi.v1;
11
10
 
11
+ message SchemaVersion {
12
+ uint32 currentVersion = 1;
13
+ uint32 minCompatVersion = 2;
14
+ }
15
+
12
16
  message EventAgent {
13
17
  weave.common.ResourceId deviceId = 1;
14
18
  ServiceId serviceId = 2;
@@ -58,7 +62,7 @@ message EventHeader {
58
62
  EventAgent producerAgent = 22;
59
63
  string producerEventKey = 23;
60
64
  map<string, string> tags = 24;
61
- nest.messages.SchemaVersion schemaVersion = 25;
65
+ SchemaVersion schemaVersion = 25;
62
66
  map<string, google.protobuf.Timestamp> serviceTimestamps = 26;
63
67
  WdmEventFields wdmEventFields = 40;
64
68
 
@@ -4,11 +4,15 @@ import "google/protobuf/any.proto";
4
4
  import "google/protobuf/field_mask.proto";
5
5
  import "google/protobuf/timestamp.proto";
6
6
  import "../../google/rpc/status.proto";
7
- import "../../nest/messages.proto";
8
7
  import "../../wdl-event-importance.proto";
9
8
 
10
9
  package nestlabs.gateway.v1;
11
10
 
11
+ message SchemaVersion {
12
+ uint32 currentVersion = 1;
13
+ uint32 minCompatVersion = 2;
14
+ }
15
+
12
16
  message TraitStateNotification {
13
17
  google.protobuf.Any state = 1;
14
18
  google.protobuf.FieldMask stateMask = 2;
@@ -42,7 +46,7 @@ message Event {
42
46
  string subjectPairerId = 10;
43
47
  string subjectTypeName = 11;
44
48
  string subjectInstanceId = 12;
45
- nest.messages.SchemaVersion schemaVersion = 13;
49
+ SchemaVersion schemaVersion = 13;
46
50
  }
47
51
 
48
52
  message TraitRequest {
@@ -108,7 +112,7 @@ message TraitGetStateResponse {
108
112
 
109
113
  message TraitInfo {
110
114
  string traitType = 1;
111
- nest.messages.SchemaVersion schemaVersion = 2;
115
+ SchemaVersion schemaVersion = 2;
112
116
  }
113
117
 
114
118
  message TraitUpdateStateRequest {
@@ -116,7 +120,7 @@ message TraitUpdateStateRequest {
116
120
  google.protobuf.Any state = 2;
117
121
  google.protobuf.FieldMask stateMask = 3;
118
122
  uint64 matchPublisherVersion = 4;
119
- nest.messages.SchemaVersion schemaVersion = 5;
123
+ SchemaVersion schemaVersion = 5;
120
124
  }
121
125
 
122
126
  message TraitNotifyRequest {
@@ -139,7 +143,7 @@ message TraitCommand {
139
143
  google.protobuf.Timestamp expiryTime = 3;
140
144
  bytes authenticator = 4;
141
145
  uint64 matchPublisherVersion = 5;
142
- nest.messages.SchemaVersion schemaVersion = 6;
146
+ SchemaVersion schemaVersion = 6;
143
147
  string namespaceId = 7;
144
148
  }
145
149
 
@@ -183,7 +187,7 @@ message ResourceInfo {
183
187
  message IfaceInfo {
184
188
  string ifaceType = 1;
185
189
  repeated IfaceTraitInfo ifaceTraitInfos = 2;
186
- nest.messages.SchemaVersion schemaVersion = 6;
190
+ SchemaVersion schemaVersion = 6;
187
191
  }
188
192
 
189
193
  message IfaceTraitInfo {
@@ -231,43 +235,45 @@ message ResourceNotifyResponse {
231
235
  repeated TraitNotifyResponse traitResponses = 2;
232
236
  }
233
237
 
234
- message ResourceCommandRequest {
235
- ResourceRequest resourceRequest = 1;
236
- repeated ResourceCommand resourceCommands = 2;
237
- }
238
-
239
238
  message ResourceCommand {
240
239
  string traitLabel = 1;
241
240
  google.protobuf.Any command = 2;
242
241
  google.protobuf.Timestamp expiryTime = 3;
243
242
  bytes authenticator = 4;
244
243
  uint64 matchPublisherVersion = 5;
245
- nest.messages.SchemaVersion schemaVersion = 6;
244
+ SchemaVersion schemaVersion = 6;
246
245
  string resourceType = 7;
247
246
  }
248
247
 
249
- message ResourceCommandResponse {
248
+ message SendCommandRequest {
250
249
  ResourceRequest resourceRequest = 1;
251
- repeated TraitOperation traitOperations = 2;
250
+ repeated ResourceCommand resourceCommands = 2;
252
251
  }
253
252
 
254
- message ResourceCommandResponseFromAPI {
255
- repeated ResourceCommandResponse resourceCommandResponse = 1;
256
- string unknown = 2;
253
+ message SendCommandResponse {
254
+ message ResourceCommandResponse {
255
+ ResourceRequest resourceRequest = 1;
256
+ repeated TraitOperation traitOperations = 2;
257
+ }
258
+
259
+ repeated ResourceCommandResponse sendCommandResponse = 1;
257
260
  }
258
261
 
259
- message BatchTraitUpdateStateRequest {
260
- repeated TraitUpdateStateRequest requests = 1;
262
+ message BatchUpdateStateRequest {
263
+ repeated TraitUpdateStateRequest batchUpdateStateRequest = 1;
261
264
  }
262
265
 
263
- message BatchTraitOperation {
264
- repeated TraitOperation traitOperation = 1;
266
+ message BatchUpdateStateResponse {
267
+ message TraitOperationStateResponse {
268
+ repeated TraitOperation traitOperations = 1;
269
+ }
270
+ repeated TraitOperationStateResponse batchUpdateStateResponse = 1;
265
271
  }
266
272
 
267
273
  service TraitBatchApi {
268
- rpc BatchUpdateState(BatchTraitUpdateStateRequest) returns (BatchTraitOperation);
274
+ rpc BatchUpdateState(BatchUpdateStateRequest) returns (BatchUpdateStateResponse);
269
275
  }
270
276
 
271
277
  service ResourceApi {
272
- rpc SendCommand(ResourceCommandRequest) returns (ResourceCommandResponse);
278
+ rpc SendCommand(SendCommandRequest) returns (SendCommandResponse);
273
279
  }
@@ -3,7 +3,6 @@ syntax = "proto3";
3
3
  import "google/protobuf/any.proto";
4
4
  import "google/protobuf/field_mask.proto";
5
5
  import "google/protobuf/timestamp.proto";
6
- import "../../nest/messages.proto";
7
6
  import "../../nestlabs/gateway/v1.proto";
8
7
 
9
8
  package nestlabs.gateway.v2;
@@ -20,17 +19,22 @@ enum StateType {
20
19
  ACCEPTED = 2;
21
20
  }
22
21
 
22
+ message SchemaVersion {
23
+ uint32 currentVersion = 1;
24
+ uint32 minCompatVersion = 2;
25
+ }
26
+
23
27
  message TraitMeta {
24
28
  string traitLabel = 1;
25
29
  string type = 2;
26
- nest.messages.SchemaVersion schemaVersion = 3;
30
+ SchemaVersion schemaVersion = 3;
27
31
  }
28
32
 
29
33
  message IfaceMeta {
30
34
  string ifaceLabel = 1;
31
35
  string type = 2;
32
36
  map<string, string> traitLabelMapping = 3;
33
- nest.messages.SchemaVersion schemaVersion = 4;
37
+ SchemaVersion schemaVersion = 4;
34
38
  }
35
39
 
36
40
  message ResourceMeta {
@@ -84,11 +88,15 @@ message TraitOperationList {
84
88
  }
85
89
 
86
90
  message ObserveResponse {
87
- repeated ResourceMeta resourceMetas = 1;
88
- bool initialResourceMetasContinue = 2;
89
- repeated TraitState traitStates = 3;
90
- repeated TraitOperationList traitOperationLists = 4;
91
- google.protobuf.Timestamp currentTime = 5;
91
+ message ObserveResponse {
92
+ repeated ResourceMeta resourceMetas = 1;
93
+ bool initialResourceMetasContinue = 2;
94
+ repeated TraitState traitStates = 3;
95
+ repeated TraitOperationList traitOperationLists = 4;
96
+ google.protobuf.Timestamp currentTime = 5;
97
+ }
98
+
99
+ repeated ObserveResponse observeResponse = 1;
92
100
  }
93
101
 
94
102
  service GatewayService {
@@ -1,9 +1,6 @@
1
- // Protobuf schema for Nest Observe and Nest BatchUpdateState API calls
2
-
3
1
  syntax = "proto3";
4
2
 
5
3
  import "google/trait/product/camera.proto";
6
- import "nest/messages.proto";
7
4
  import "nest/trait/audio.proto";
8
5
  import "nest/trait/detector.proto";
9
6
  import "nest/trait/hvac.proto";
@@ -26,6 +23,7 @@ import "nest/trait/service.proto";
26
23
  import "nest/trait/structure.proto";
27
24
  import "nest/trait/ui.proto";
28
25
  import "weave/common.proto";
26
+ import "weave/trait/actuator.proto";
29
27
  import "weave/trait/audio.proto";
30
28
  import "weave/trait/description.proto";
31
29
  import "weave/trait/heartbeat.proto";
@@ -38,27 +36,4 @@ import "weave/trait/schedule.proto";
38
36
  import "weave/trait/security.proto";
39
37
  import "weave/trait/time.proto";
40
38
  import "nestlabs/gateway/v2.proto";
41
- import "nestlabs/history/v1.proto";
42
- import "googlehome/foyer.proto";
43
-
44
- package nest.rpc;
45
-
46
- message NestTraitSetRequest {
47
- message TraitObject {
48
- nestlabs.gateway.v2.TraitId traitId = 1;
49
- google.protobuf.Any property = 2;
50
- }
51
-
52
- repeated TraitObject set = 1;
53
- }
54
-
55
- message NestIncomingMessage {
56
- repeated nestlabs.gateway.v2.ResourceMeta resourceMetas = 1;
57
- repeated nestlabs.gateway.v2.TraitState get = 3;
58
- }
59
-
60
- message StreamBody {
61
- repeated NestIncomingMessage message = 1;
62
- google.rpc.Status status = 2;
63
- repeated bytes noop = 15;
64
- }
39
+ import "nestlabs/history/v1.proto";
@@ -0,0 +1,13 @@
1
+ syntax = "proto3";
2
+
3
+ import "google/protobuf/wrappers.proto";
4
+
5
+ package weave.trait.actuator;
6
+
7
+ message OnOffTrait {
8
+ message SetStateRequest {
9
+ bool on = 1;
10
+ }
11
+
12
+ bool on = 1;
13
+ }