google-device-access: add readmes.

This commit is contained in:
Koushik Dutta
2022-01-28 20:40:02 -08:00
parent d619d9870c
commit 5aa3818bf7
5 changed files with 25 additions and 5 deletions

View File

@@ -0,0 +1,7 @@
## Gen 1 Camera Setup
Install the Rebroadcast Plugin. Since this is a cloud camera, prebuffering is not enabled by default. This means that any motion leading up to an event may not be captured. Enable prebuffering if your internet service will not have bandwidth issues with a persistent connection continually downloading your camera stream.
Gen 1 Cameras only provide recent event snapshots. If there was no recent event, you will see "Snapshot Unavailable" in HomeKit while the stream is inactive. If prebuffering is enabled, the snapshots will always be available.
The Gen 1 Camera requires HomeKit Transcoding to be enabled. Under the HomeKit Transcoding settings, enable transcoding on streams and recordings. Leave the decoder and encoder arguments blank. The defaults have been found to work the most reliably.

View File

@@ -0,0 +1,5 @@
## Gen 2 Camera Setup
Install the Rebroadcast Plugin. Since this is a cloud camera, prebuffering is not enabled by default. This means that any motion leading up to an event may not be captured. Enable prebuffering if your internet service will not have bandwidth issues with a persistent connection continually downloading your camera stream.
Gen 2 Cameras do not provide snapshots. You will see "Snapshot Unavailable" in HomeKit while the stream is inactive. If prebuffering is enabled, the snapshots will always be available.

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/google-device-access",
"version": "0.0.75",
"version": "0.0.76",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/google-device-access",
"version": "0.0.75",
"version": "0.0.76",
"dependencies": {
"@googleapis/smartdevicemanagement": "^0.2.0",
"axios": "^0.21.1",

View File

@@ -45,5 +45,5 @@
"@types/node": "^14.17.11",
"@types/url-parse": "^1.4.3"
},
"version": "0.0.75"
"version": "0.0.76"
}

View File

@@ -1,4 +1,4 @@
import sdk, { DeviceManifest, DeviceProvider, HttpRequest, HttpRequestHandler, HttpResponse, HumiditySensor, MediaObject, MotionSensor, OauthClient, Refresh, ScryptedDeviceType, ScryptedInterface, Setting, Settings, TemperatureSetting, TemperatureUnit, Thermometer, ThermostatMode, VideoCamera, MediaStreamOptions, BinarySensor, DeviceInformation, BufferConverter, ScryptedMimeTypes, RTCAVMessage, RTCAVSource, Camera, PictureOptions, ObjectsDetected, ObjectDetector, ObjectDetectionTypes, FFMpegInput, RequestMediaStreamOptions } from '@scrypted/sdk';
import sdk, { DeviceManifest, DeviceProvider, HttpRequest, HttpRequestHandler, HttpResponse, HumiditySensor, MediaObject, MotionSensor, OauthClient, Refresh, ScryptedDeviceType, ScryptedInterface, Setting, Settings, TemperatureSetting, TemperatureUnit, Thermometer, ThermostatMode, VideoCamera, MediaStreamOptions, BinarySensor, DeviceInformation, BufferConverter, ScryptedMimeTypes, RTCAVMessage, RTCAVSource, Camera, PictureOptions, ObjectsDetected, ObjectDetector, ObjectDetectionTypes, FFMpegInput, RequestMediaStreamOptions, Readme } from '@scrypted/sdk';
import { ScryptedDeviceBase } from '@scrypted/sdk';
import qs from 'query-string';
import ClientOAuth2 from 'client-oauth2';
@@ -17,6 +17,9 @@ const SdmSignalingPrefix = ScryptedMimeTypes.RTCAVSignalingPrefix + 'gda/';
const SdmDeviceSignalingPrefix = SdmSignalingPrefix + 'x-';
const black = fs.readFileSync('black.jpg');
const readmeV1 = fs.readFileSync('README-camera-v1.md').toString();
const readmeV2 = fs.readFileSync('README-camera-v2.md').toString();
function getSdmRtspMediaStreamOptions(): MediaStreamOptions {
return {
id: 'default',
@@ -88,7 +91,7 @@ function toNestMode(mode: ThermostatMode): string {
}
}
class NestCamera extends ScryptedDeviceBase implements Camera, VideoCamera, MotionSensor, BinarySensor, BufferConverter, ObjectDetector {
class NestCamera extends ScryptedDeviceBase implements Readme, Camera, VideoCamera, MotionSensor, BinarySensor, BufferConverter, ObjectDetector {
signalingMime: string;
lastMotionEventId: string;
lastImage: Promise<Buffer>;
@@ -105,6 +108,10 @@ class NestCamera extends ScryptedDeviceBase implements Camera, VideoCamera, Moti
this.toMimeType = this.signalingMime;
}
async getReadmeMarkdown(): Promise<string> {
return this.isWebRtc ? readmeV2 : readmeV1;
}
// not sure if this works? there is a camera snapshot generate image thing, but it
// does not exist on the new cameras.
getDetectionInput(detectionId: any, eventId?: any): Promise<MediaObject> {
@@ -769,6 +776,7 @@ class GoogleSmartDeviceAccess extends ScryptedDeviceBase implements OauthClient,
ScryptedInterface.Camera,
ScryptedInterface.MotionSensor,
ScryptedInterface.ObjectDetector,
ScryptedInterface.Readme,
];
let type = ScryptedDeviceType.Camera;