From e172feeeeb3715a76fc5e7625b3c0da7d17312bc Mon Sep 17 00:00:00 2001 From: ErrorErrorError Date: Fri, 2 Sep 2022 15:33:30 -0500 Subject: [PATCH] Fix issue not being able to select your prebufffer - 2 way audio support test - bump to 0.0.7-beta.1 - improve readme docs --- plugins/tuya/README.md | 17 ++++++++++------- plugins/tuya/package-lock.json | 4 ++-- plugins/tuya/package.json | 2 +- plugins/tuya/src/camera.ts | 5 +++-- plugins/tuya/src/main.ts | 7 ++++--- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/plugins/tuya/README.md b/plugins/tuya/README.md index 6a6a0ba42..1ac1999d0 100644 --- a/plugins/tuya/README.md +++ b/plugins/tuya/README.md @@ -4,7 +4,14 @@ This is a Tuya controller that integrates Tuya devices, specifically cameras, in The plugin will discover all the cameras within Tuya Cloud IoT project and report them to Scrypted, including motion events, for the ones that are supported. +## Features +- Supports Tuya Cameras Streaming. +- Supports Tuya Doorbells with ring notifications. +- Supports 2-Way communication (for devices that support WebRTC). + ## Requirements + +### Access Id, Access Key, and User Id In order to retrieve `Access Id` and `Access Key`, you must follow the guide below: - [Using Smart Home PaaS (TuyaSmart, SmartLife, ect...)](https://developer.tuya.com/en/docs/iot/Platform_Configuration_smarthome?id=Kamcgamwoevrx&_source=6435717a3be1bc67fdd1f6699a1a59ac) @@ -12,12 +19,8 @@ In order to retrieve `Access Id` and `Access Key`, you must follow the guide bel Once you have retreived both the `Access Id` and `Access Key` from the project, you can get the `User Id` by going to Tuya Cloud IoT -> Select the Project -> Devices -> Link Tuya App Account -> and then get the UID. -You also need to enable Messages Service in your project in order to receive real time notifications to Scrypted. (motion events, online/offline, light switch ect...) The way this is achieved is by following this [guide](https://developer.tuya.com/en/docs/iot/subscribe-mq?id=Kavqcrvckbh9h). +### Tuya Pulsar +You need to enable Messages Service in your project in order to receive real time notifications to Scrypted. (motion events, online/offline, light switch ect...) The way this is achieved is by following this [guide](https://developer.tuya.com/en/docs/iot/subscribe-mq?id=Kavqcrvckbh9h). - You do not need to set an alert notification of your phone. -- This might not be necessary in the future if I believe MQTT is the way to go, but in the mean time, TuyaPulse is required for this project. - - -## TODOs -- Fix 2-way talk for supported platforms (Can only work with WebRTC since we only get one stream with RTSPS) -- Add support for camera doorbells (Just need to implement doorbell notification) \ No newline at end of file + diff --git a/plugins/tuya/package-lock.json b/plugins/tuya/package-lock.json index 6c447697a..713b5ce1e 100644 --- a/plugins/tuya/package-lock.json +++ b/plugins/tuya/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/tuya", - "version": "0.0.7-beta.0", + "version": "0.0.7-beta.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/tuya", - "version": "0.0.7-beta.0", + "version": "0.0.7-beta.1", "dependencies": { "@scrypted/common": "file:../../common", "@scrypted/sdk": "file:../../sdk", diff --git a/plugins/tuya/package.json b/plugins/tuya/package.json index 15655339a..c9fdefb55 100644 --- a/plugins/tuya/package.json +++ b/plugins/tuya/package.json @@ -46,5 +46,5 @@ "@types/uuid": "^8.3.4", "@types/ws": "^8.5.3" }, - "version": "0.0.7-beta.0" + "version": "0.0.7-beta.1" } diff --git a/plugins/tuya/src/camera.ts b/plugins/tuya/src/camera.ts index 874c4865d..ac185a513 100644 --- a/plugins/tuya/src/camera.ts +++ b/plugins/tuya/src/camera.ts @@ -387,7 +387,8 @@ export class TuyaCamera extends ScryptedDeviceBase implements DeviceProvider, Vi async getVideoStreamOptions(): Promise { return [ { - id: 'default', + id: 'cloud-rtsp', + name: 'Cloud RTSP', container: 'rtsp', video: { codec: 'h264', @@ -474,7 +475,7 @@ export class TuyaCamera extends ScryptedDeviceBase implements DeviceProvider, Vi } // By the time this is called, scrypted would have already reported the device - // Only set light switch on cameras that have a status light indicator. + // Only set light switch on cameras that have a light switch. if (TuyaDevice.hasLightSwitch(camera)) { this.getDevice(this.nativeLightSwitchId)?.updateState(camera); diff --git a/plugins/tuya/src/main.ts b/plugins/tuya/src/main.ts index 0f38c4901..ffe619d51 100644 --- a/plugins/tuya/src/main.ts +++ b/plugins/tuya/src/main.ts @@ -192,7 +192,7 @@ export class TuyaController extends ScryptedDeviceBase implements DeviceProvider let deviceInfo: string[] = [`Creating camera device for: \n- ${camera.name}`]; if (TuyaDevice.isDoorbell(camera)) { - deviceInfo.push(`- Doorbell Notification`); + deviceInfo.push(`- Doorbell Notification Supported`); device.interfaces.push(ScryptedInterface.BinarySensor); } @@ -202,18 +202,19 @@ export class TuyaController extends ScryptedDeviceBase implements DeviceProvider } if (TuyaDevice.hasMotionDetection(camera)) { - deviceInfo.push(`- Motion Detection`); + deviceInfo.push(`- Motion Detection Supported`); device.interfaces.push(ScryptedInterface.MotionSensor); } if (await TuyaDevice.supportsWebRTC(camera, this.cloud)) { + deviceInfo.push(`- WebRTC Supported with Intercom`); device.interfaces.push(ScryptedInterface.RTCSignalingChannel); } // Device Provider if (TuyaDevice.hasLightSwitch(camera)) { - deviceInfo.push(`- Light Switch`); + deviceInfo.push(`- Has Light Switch`); device.interfaces.push(ScryptedInterface.DeviceProvider); }