Skip to content

Commit 3b39d80

Browse files
committed
0.0.5 release source files
1 parent 04d3a8b commit 3b39d80

File tree

11 files changed

+186
-123
lines changed

11 files changed

+186
-123
lines changed

CHANGELOG.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ All notable changes to `homebridge-nest-accfactory` will be documented in this f
66

77
Currently all releases are considered 'alpha' status, where things may or may not be working. Use at your own risk :-)
88

9-
## v0.0.5 (alpha)
9+
## v0.0.5 (2024/09/13)
1010

11-
- General code and bug fixes
12-
- External dependancy reductions
13-
- dropped pbf and axios libraries
14-
- Nest Cam with Floodlight support
15-
- Control light on/off and brightness
16-
- Streaming/recording still coming for newer Nest/Google camera/doorbell devices
11+
- General code cleanup and bug fixes
12+
- External dependancy reductions, dropped pbf and axios libraries
13+
- Nest Cam with Floodlight support with light on/off and brightness control
14+
- Fixed issued with setting range temperatures on Nest Thermostat(s)
1715

1816
## v0.0.4 (2024-09-07)
1917

@@ -28,7 +26,7 @@ Currently all releases are considered 'alpha' status, where things may or may no
2826
- Cleanup fix for when removing a camera/doorbell from Nest/Google
2927
- Fix for virtual weather device when missing configured city and/or state details
3028
- Fix for retrieving data from Nest systems when using both a Nest and Google accounts
31-
- Initial support newer Nest/Google camera/doorbell devices (streaming/recording - coming)
29+
- Initial support for newer Nest/Google camera/doorbell devices (streaming/recording - coming)
3230

3331
## v0.0.1 (2024-08-27)
3432

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"displayName": "Nest Accfactory",
33
"name": "homebridge-nest-accfactory",
44
"homepage": "https://github.com/n0rt0nthec4t/homebridge-nest-accfactory",
5-
"version": "0.0.5-alpha.3",
5+
"version": "0.0.5",
66
"description": "Homebridge support for Nest/Google devices including HomeKit Secure Video (HKSV) support for doorbells and cameras",
77
"license": "Apache-2.0",
88
"author": "n0rt0nthec4t",
@@ -35,7 +35,9 @@
3535
},
3636
"keywords": [
3737
"homebridge-plugin",
38+
"homebridge",
3839
"hksv",
40+
"homekit secure video",
3941
"nest",
4042
"google",
4143
"doorbell",

src/HomeKitDevice.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
// HomeKitDevice.updateServices(deviceData)
3838
// HomeKitDevice.messageServices(type, message)
3939
//
40-
// Code version 12/9/2024
40+
// Code version 13/9/2024
4141
// Mark Hulskamp
4242
'use strict';
4343

@@ -104,7 +104,8 @@ export default class HomeKitDevice {
104104
this.#eventEmitter.addListener(this.deviceData.uuid, this.#message.bind(this));
105105
}
106106

107-
// Make copy of current data and store in this object
107+
// Make a clone of current data and store in this object
108+
// Important that we done have a 'linked' cope of the object data
108109
// eslint-disable-next-line no-undef
109110
this.deviceData = structuredClone(deviceData);
110111

@@ -149,7 +150,10 @@ export default class HomeKitDevice {
149150
this.deviceData.model === '' ||
150151
typeof this.deviceData?.manufacturer !== 'string' ||
151152
this.deviceData.manufacturer === '' ||
152-
(this.#platform === undefined && typeof this.deviceData?.hkPairingCode !== 'string' && this.deviceData.hkPairingCode === '') ||
153+
(this.#platform === undefined &&
154+
typeof this.deviceData?.hkPairingCode !== 'string' &&
155+
(new RegExp(/^([0-9]{3}-[0-9]{2}-[0-9]{3})$/).test(this.deviceData.hkPairingCode) === true ||
156+
new RegExp(/^([0-9]{4}-[0-9]{4})$/).test(this.deviceData.hkPairingCode) === true)) ||
153157
(this.#platform === undefined &&
154158
typeof this.deviceData?.hkUsername !== 'string' &&
155159
new RegExp(/^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/).test(this.deviceData.hkUsername) === false)

src/camera.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export default class NestCamera extends HomeKitDevice {
9999
(value === true && this.deviceData.statusled_brightness !== 0) ||
100100
(value === false && this.deviceData.statusled_brightness !== 1)
101101
) {
102-
this.set({ 'statusled.brightness': value === true ? 0 : 1 });
102+
this.set({ statusled_brightness: value === true ? 0 : 1 });
103103
if (this?.log?.info) {
104104
this.log.info('Recording status LED on "%s" was turned', this.deviceData.description, value === true ? 'on' : 'off');
105105
}
@@ -119,7 +119,7 @@ export default class NestCamera extends HomeKitDevice {
119119
this.operatingModeService.getCharacteristic(this.hap.Characteristic.NightVision).onSet((value) => {
120120
// only change IRLed status value if different than on-device
121121
if ((value === false && this.deviceData.irled_enabled === true) || (value === true && this.deviceData.irled_enabled === false)) {
122-
this.set({ 'irled.state': value === true ? 'auto_on' : 'always_off' });
122+
this.set({ irled_enabled: value === true ? 'auto_on' : 'always_off' });
123123

124124
if (this?.log?.info) {
125125
this.log.info('Night vision on "%s" was turned', this.deviceData.description, value === true ? 'on' : 'off');
@@ -144,7 +144,7 @@ export default class NestCamera extends HomeKitDevice {
144144
(this.deviceData.streaming_enabled === true && value === true)
145145
) {
146146
// Camera state does not reflect requested state, so fix
147-
this.set({ 'streaming.enabled': value === false ? true : false });
147+
this.set({ streaming_enabled: value === false ? true : false });
148148
if (this?.log?.info) {
149149
this.log.info('Camera on "%s" was turned', this.deviceData.description, value === false ? 'on' : 'off');
150150
}
@@ -178,7 +178,7 @@ export default class NestCamera extends HomeKitDevice {
178178
(this.deviceData.audio_enabled === true && value === this.hap.Characteristic.RecordingAudioActive.DISABLE) ||
179179
(this.deviceData.audio_enabled === false && value === this.hap.Characteristic.RecordingAudioActive.ENABLE)
180180
) {
181-
this.set({ 'audio.enabled': value === this.hap.Characteristic.RecordingAudioActive.ENABLE ? true : false });
181+
this.set({ audio_enabled: value === this.hap.Characteristic.RecordingAudioActive.ENABLE ? true : false });
182182
if (this?.log?.info) {
183183
this.log.info(
184184
'Audio recording on "%s" was turned',

src/doorbell.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Nest Doorbell(s)
22
// Part of homebridge-nest-accfactory
33
//
4-
// Code version 8/9/2024
4+
// Code version 12/9/2024
55
// Mark Hulskamp
66
'use strict';
77

@@ -41,7 +41,7 @@ export default class NestDoorbell extends NestCamera {
4141
this.switchService.getCharacteristic(this.hap.Characteristic.On).onSet((value) => {
4242
if (value !== this.deviceData.indoor_chime_enabled) {
4343
// only change indoor chime status value if different than on-device
44-
this.set({ 'doorbell.indoor_chime.enabled': value });
44+
this.set({ indoor_chime_enabled: value });
4545

4646
this?.log?.info && this.log.info('Indoor chime on "%s" was turned', this.deviceData.description, value === true ? 'on' : 'off');
4747
}

src/protect.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Nest Protect
22
// Part of homebridge-nest-accfactory
33
//
4-
// Code version 9/8/2024
4+
// Code version 12/9/2024
55
// Mark Hulskamp
66
'use strict';
77

@@ -80,7 +80,7 @@ export default class NestProtect extends HomeKitDevice {
8080
EveSmoke_alarmtest: this.deviceData.self_test_in_progress,
8181
EveSmoke_heatstatus: this.deviceData.heat_status,
8282
EveSmoke_hushedstate: this.deviceData.hushed_state,
83-
EveSmoke_statusled: this.deviceData.ntp_green_led,
83+
EveSmoke_statusled: this.deviceData.ntp_green_led_enable,
8484
EveSmoke_smoketestpassed: this.deviceData.smoke_test_passed,
8585
EveSmoke_heattestpassed: this.deviceData.heat_test_passed,
8686
});
@@ -202,7 +202,7 @@ export default class NestProtect extends HomeKitDevice {
202202
this.deviceData.latest_alarm_test = deviceData.latest_alarm_test;
203203
this.deviceData.self_test_in_progress = deviceData.self_test_in_progress;
204204
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;
206206
this.deviceData.smoke_test_passed = deviceData.smoke_test_passed;
207207
this.deviceData.heat_test_passed = deviceData.heat_test_passed;
208208
this.historyService.updateEveHome(this.smokeService, this.#EveHomeGetcommand.bind(this));
@@ -216,7 +216,7 @@ export default class NestProtect extends HomeKitDevice {
216216
EveHomeGetData.lastalarmtest = this.deviceData.latest_alarm_test;
217217
EveHomeGetData.alarmtest = this.deviceData.self_test_in_progress;
218218
EveHomeGetData.heatstatus = this.deviceData.heat_status;
219-
EveHomeGetData.statusled = this.deviceData.ntp_green_led;
219+
EveHomeGetData.statusled = this.deviceData.ntp_green_led_enable;
220220
EveHomeGetData.smoketestpassed = this.deviceData.smoke_test_passed;
221221
EveHomeGetData.heattestpassed = this.deviceData.heat_test_passed;
222222
EveHomeGetData.hushedstate = this.deviceData.hushed_state;
@@ -233,7 +233,6 @@ export default class NestProtect extends HomeKitDevice {
233233
//this.log.info('Eve Smoke Alarm test', (EveHomeSetData.alarmtest === true ? 'start' : 'stop'));
234234
}
235235
if (typeof EveHomeSetData?.statusled === 'boolean') {
236-
this.deviceData.ntp_green_led = EveHomeSetData.statusled; // Do quick status update as setting Nest values does take sometime
237236
this.set({ ntp_green_led_enable: EveHomeSetData.statusled });
238237
}
239238
}

src/protobuf/google/trait/product/camera.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ message FloodlightSettingsTrait {
5050
OnOffTrigger liveViewingTrigger = 4;
5151
DaylightSensitivity daylightSensitivity = 5;
5252
OnOffTrigger cameraEventTrigger = 6;
53+
uin32 lightState = 7;
5354
}

src/protobuf/nestlabs/gateway/v1.proto

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,7 @@ message SendCommandResponse {
260260
}
261261

262262
message BatchUpdateStateRequest {
263-
message TraitObject {
264-
nestlabs.gateway.v2.TraitId traitId = 1;
265-
google.protobuf.Any property = 2;
266-
}
267-
268-
repeated TraitObject batchUpdateStateRequest = 1;
263+
repeated TraitUpdateStateRequest batchUpdateStateRequest = 1;
269264
}
270265

271266
message BatchUpdateStateResponse {

src/protobuf/root.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import "nest/trait/service.proto";
2323
import "nest/trait/structure.proto";
2424
import "nest/trait/ui.proto";
2525
import "weave/common.proto";
26+
import "weave/trait/actuator.proto";
2627
import "weave/trait/audio.proto";
2728
import "weave/trait/description.proto";
2829
import "weave/trait/heartbeat.proto";
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
}

0 commit comments

Comments
 (0)