homebridge-ring 11.7.6 → 11.7.7
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 +11 -0
- package/lib/config.js +4 -3
- package/lib/homebridge-ui/server.js +8 -1
- package/lib/ring-platform.js +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# homebridge-ring
|
|
2
2
|
|
|
3
|
+
## 11.7.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f3e66fd`](https://github.com/dgreif/ring/commit/f3e66fdbeb960a9ba35ff26289a054c537bac890) Thanks [@dgreif](https://github.com/dgreif)! - Subscribe to ding/motion events every time the user session is refreshed. This currently happens every 12 hours. This is an attempt to fix motion/ding notifications after restarting, but I am unable to reproduce the issue and verify this change fixes it.
|
|
8
|
+
|
|
9
|
+
- [`b9881a7`](https://github.com/dgreif/ring/commit/b9881a7b5ed6684bf6dc0464354af7acf1cc77ea) Thanks [@dgreif](https://github.com/dgreif)! - Prevent a duplicate device named "Device name not found" from being created when logging into homebridge with the homebridge ui.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`f3e66fd`](https://github.com/dgreif/ring/commit/f3e66fdbeb960a9ba35ff26289a054c537bac890), [`af7f44e`](https://github.com/dgreif/ring/commit/af7f44e5f1f97274a8902063b621bde1e94bd08f)]:
|
|
12
|
+
- ring-client-api@11.7.7
|
|
13
|
+
|
|
3
14
|
## 11.7.6
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/lib/config.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.debug = exports.getSystemId = exports.updateHomebridgeConfig = void 0;
|
|
3
|
+
exports.debug = exports.getSystemId = exports.updateHomebridgeConfig = exports.controlCenterDisplayName = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const crypto_1 = require("crypto");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const systemIdFileName = '.ring.json';
|
|
8
|
+
exports.controlCenterDisplayName = 'homebridge-ring';
|
|
8
9
|
function updateHomebridgeConfig(homebridge, update) {
|
|
9
10
|
const configPath = homebridge.user.configPath(), config = (0, fs_1.readFileSync)(configPath).toString(), updatedConfig = update(config);
|
|
10
11
|
if (config !== updatedConfig) {
|
|
@@ -17,8 +18,8 @@ exports.updateHomebridgeConfig = updateHomebridgeConfig;
|
|
|
17
18
|
function createSystemId() {
|
|
18
19
|
return (0, crypto_1.createHash)('sha256').update((0, crypto_1.randomBytes)(32)).digest('hex');
|
|
19
20
|
}
|
|
20
|
-
function getSystemId(
|
|
21
|
-
const
|
|
21
|
+
function getSystemId(homebridgeStoragePath) {
|
|
22
|
+
const filePath = (0, path_1.join)(homebridgeStoragePath, systemIdFileName);
|
|
22
23
|
try {
|
|
23
24
|
const ringContext = JSON.parse((0, fs_1.readFileSync)(filePath).toString());
|
|
24
25
|
if (ringContext.systemId) {
|
|
@@ -3,12 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
/* eslint-disable no-console */
|
|
4
4
|
const plugin_ui_utils_1 = require("@homebridge/plugin-ui-utils");
|
|
5
5
|
const rest_client_1 = require("ring-client-api/rest-client");
|
|
6
|
+
const config_1 = require("../config");
|
|
6
7
|
class PluginUiServer extends plugin_ui_utils_1.HomebridgePluginUiServer {
|
|
7
8
|
constructor() {
|
|
8
9
|
super();
|
|
9
10
|
this.generateCode = async ({ email, password }) => {
|
|
10
11
|
console.log(`Logging in with email '${email}'`);
|
|
11
|
-
|
|
12
|
+
const storagePath = this.homebridgeStoragePath;
|
|
13
|
+
this.restClient = new rest_client_1.RingRestClient({
|
|
14
|
+
email,
|
|
15
|
+
password,
|
|
16
|
+
controlCenterDisplayName: config_1.controlCenterDisplayName,
|
|
17
|
+
systemId: storagePath ? (0, config_1.getSystemId)(storagePath) : undefined,
|
|
18
|
+
});
|
|
12
19
|
try {
|
|
13
20
|
const { refresh_token } = await this.restClient.getCurrentAuth();
|
|
14
21
|
// If we get here, 2fa was not required. I'm not sure this is possible anymore, but it's here just in case
|
package/lib/ring-platform.js
CHANGED
|
@@ -152,8 +152,8 @@ class RingPlatform {
|
|
|
152
152
|
this.homebridgeAccessories[accessory.UUID] = accessory;
|
|
153
153
|
}
|
|
154
154
|
async connectToApi() {
|
|
155
|
-
const { api, config } = this, systemId = (0, config_1.getSystemId)(api), ringApi = new ring_client_api_1.RingApi({
|
|
156
|
-
controlCenterDisplayName:
|
|
155
|
+
const { api, config } = this, systemId = (0, config_1.getSystemId)(api.user.storagePath()), ringApi = new ring_client_api_1.RingApi({
|
|
156
|
+
controlCenterDisplayName: config_1.controlCenterDisplayName,
|
|
157
157
|
...config,
|
|
158
158
|
systemId,
|
|
159
159
|
}), locations = await ringApi.getLocations(), cachedAccessoryIds = Object.keys(this.homebridgeAccessories), platformAccessories = [], externalAccessories = [], activeAccessoryIds = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-ring",
|
|
3
|
-
"version": "11.7.
|
|
3
|
+
"version": "11.7.7",
|
|
4
4
|
"description": "Homebridge plugin for Ring doorbells, cameras, security alarm system and smart lighting",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@homebridge/camera-utils": "^2.2.0",
|
|
15
15
|
"@homebridge/plugin-ui-utils": "^0.0.19",
|
|
16
|
-
"ring-client-api": "11.7.
|
|
16
|
+
"ring-client-api": "11.7.7"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"concurrently": "^7.6.0",
|