From 68e21045c718f246a906f040b74bf2f0bc2fc2e7 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Mon, 20 Dec 2021 13:59:20 -0800 Subject: [PATCH] google-device-access: fix settings descriptions --- .../google-device-access/package-lock.json | 4 ++-- plugins/google-device-access/package.json | 2 +- plugins/google-device-access/src/main.ts | 22 ++++++++++--------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/plugins/google-device-access/package-lock.json b/plugins/google-device-access/package-lock.json index d8d0c518f..2ebb41e8d 100644 --- a/plugins/google-device-access/package-lock.json +++ b/plugins/google-device-access/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/google-device-access", - "version": "0.0.36", + "version": "0.0.39", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/google-device-access", - "version": "0.0.36", + "version": "0.0.39", "dependencies": { "@googleapis/smartdevicemanagement": "^0.2.0", "axios": "^0.21.1", diff --git a/plugins/google-device-access/package.json b/plugins/google-device-access/package.json index d1667aa74..cb1bae801 100644 --- a/plugins/google-device-access/package.json +++ b/plugins/google-device-access/package.json @@ -43,5 +43,5 @@ "@types/node": "^14.17.11", "@types/url-parse": "^1.4.3" }, - "version": "0.0.36" + "version": "0.0.39" } diff --git a/plugins/google-device-access/src/main.ts b/plugins/google-device-access/src/main.ts index 735e5f828..040860374 100644 --- a/plugins/google-device-access/src/main.ts +++ b/plugins/google-device-access/src/main.ts @@ -8,8 +8,6 @@ import throttle from 'lodash/throttle'; const { deviceManager, mediaManager, endpointManager } = sdk; -console.log(ScryptedInterfaceProperty) - const refreshFrequency = 60; function fromNestMode(mode: string): ThermostatMode { @@ -63,6 +61,7 @@ class NestCamera extends ScryptedDeviceBase implements VideoCamera, MotionSensor const u = result.data.results.streamUrls.rtspUrl; return mediaManager.createFFmpegMediaObject({ + url: undefined, inputArguments: [ "-rtsp_transport", "tcp", @@ -269,7 +268,10 @@ class GoogleSmartDeviceAccess extends ScryptedDeviceBase implements OauthClient, updateClient() { this.clientId = this.storage.getItem('clientId') || '827888101440-6jsq0saim1fh1abo6bmd9qlhslemok2t.apps.googleusercontent.com'; this.clientSecret = this.storage.getItem('clientSecret') || 'nXgrebmaHNvZrKV7UDJV3hmg'; - this.projectId = this.storage.getItem('projectId') || '778da527-9690-4368-9c96-6872bb29e7a0'; + this.projectId = this.storage.getItem('projectId');// || '778da527-9690-4368-9c96-6872bb29e7a0'; + if (!this.projectId) { + this.log.a('Enter a valid project ID. Setup instructions for Nest: https://www.home-assistant.io/integrations/nest/'); + } this.authorizationUri = `https://nestservices.google.com/partnerconnections/${this.projectId}/auth` this.client = new ClientOAuth2({ @@ -362,18 +364,18 @@ class GoogleSmartDeviceAccess extends ScryptedDeviceBase implements OauthClient, key: 'projectId', title: 'Project ID', description: 'Google Device Access Project ID', - value: this.storage.getItem('projectId') || '827888101440-6jsq0saim1fh1abo6bmd9qlhslemok2t.apps.googleusercontent.com', + value: this.storage.getItem('projectId'), // || '778da527-9690-4368-9c96-6872bb29e7a0', }, { key: 'clientId', - title: 'Client ID', - description: 'Google Device Access Client ID', - value: this.storage.getItem('clientId') || '778da527-9690-4368-9c96-6872bb29e7a0', + title: 'Google OAuth Client ID', + description: 'Optional: The Google OAuth Client ID to use. The default value will use Scrypted Cloud OAuth login.', + value: this.storage.getItem('clientId') || '827888101440-6jsq0saim1fh1abo6bmd9qlhslemok2t.apps.googleusercontent.com', }, { key: 'clientSecret', - title: 'Client Secret', - description: 'Google Device Access Client Secret', + title: 'Google OAuth Client Secret', + description: 'Optional: The Google OAuth Client Secret to use. The default value will use Scrypted Cloud login.', value: this.storage.getItem('clientSecret') || 'nXgrebmaHNvZrKV7UDJV3hmg', }, { @@ -383,7 +385,7 @@ class GoogleSmartDeviceAccess extends ScryptedDeviceBase implements OauthClient, readonly: true, value: endpoint, placeholder: 'http://somehost.dyndns.org', - } + }, ]; }