scrypted-tuya 0.1.0-beta.9

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 ADDED
@@ -0,0 +1,125 @@
1
+ <details>
2
+ <summary>Changelog</summary>
3
+
4
+ ### 0.1.0-beta.7
5
+
6
+ fix: fix setTimeout undefined function
7
+ bump version
8
+
9
+
10
+ ### 0.1.0-beta.6
11
+
12
+ chore: update changelog
13
+ fix: ensure timeout is actually correct and bound corretly
14
+ chore: bump version
15
+
16
+
17
+ ### 0.1.0-beta.5
18
+
19
+ chore: update changelog
20
+ fix: use correct property for checking connection state
21
+ chore: bump version
22
+
23
+
24
+ ### 0.1.0-beta.4
25
+
26
+ fix: resolve mqtt connection issues
27
+ bump version
28
+
29
+
30
+ ### 0.1.0-beta.3
31
+
32
+ fixchangelog
33
+ changelog
34
+ quick fix
35
+ bump to beta 3
36
+
37
+
38
+ ### 0.1.0-beta.2
39
+
40
+ update commit
41
+ bump version
42
+
43
+
44
+ ### 0.1.0-beta.1
45
+
46
+ improve mqtt reconnect, also update status
47
+ wip: prevent setting motion if device has no motion detection
48
+ fix: resolve indicator not updating
49
+ feat: add support for light accessory in camera
50
+ wip: fetch rtsp from Tuya Sharing SDK
51
+
52
+
53
+ ### 0.1.0
54
+
55
+ wip: allow changing between different login methods
56
+ wip: remove websocket for cameras since they are not supported
57
+
58
+
59
+ ### 0.0.9
60
+
61
+ wip: update components
62
+
63
+
64
+ ### 0.0.8
65
+
66
+ format code
67
+ replace tool to use `ffmpeg` and bump v0.0.8
68
+
69
+
70
+ ### 0.0.7
71
+
72
+ plugins: update tsconfig.json
73
+ Updated Tuya to v0.0.7 (#408)
74
+
75
+
76
+ ### 0.0.7-beta.2
77
+
78
+ tuya: fix crlf in candidate, fix empty stream name in rebroadcast, webrtc logging
79
+ remove null candidate
80
+
81
+
82
+ ### 0.0.7-beta.1
83
+
84
+ Fix issue not being able to select your prebufffer
85
+
86
+
87
+ ### 0.0.7-beta.0
88
+
89
+ Added support for webrtc, testing needed
90
+
91
+
92
+ ### 0.0.6
93
+
94
+ Improvements in WebRTC
95
+ add initial support for webrtc
96
+ alllow triggering doorbell (#361)
97
+
98
+
99
+ ### 0.0.5
100
+
101
+ [Tuya Plugin] Fixed issue with devices not loading (#355)
102
+
103
+
104
+ ### 0.0.4
105
+
106
+ Fix race condition for Tuya Devices (#351)
107
+
108
+
109
+ ### 0.0.3
110
+
111
+ tuya: publish
112
+
113
+
114
+ ### 0.0.1
115
+
116
+ tuya: project cleanups, remove unnecessary dependencies
117
+ Add Tuya Camera (and Doorbell Cameras) Support (#350)
118
+
119
+
120
+ </details>
121
+
122
+ ## 0.1.0-beta.9
123
+
124
+ - Request the highest recognised writable quality advertised by the camera schema before RTSP allocation.
125
+ - Safely fall back to Tuya's server-selected quality.
package/Development.md ADDED
@@ -0,0 +1,15 @@
1
+ # Development
2
+ This document describes how to build and run this plugin.
3
+
4
+ ## npm commands
5
+ - npm run scrypted-webpack
6
+ - npm run scrypted-deploy
7
+ - npm run scrypted-debug
8
+
9
+ ## scrypted distribution via npm
10
+ 1. Ensure package.json is set up properly for publishing on npm.
11
+ 2. npm publish
12
+
13
+ ## Visual Studio Code configuration
14
+ - If using a remote server, edit .vscode/settings.json to specify the IP Address of the Scrypted server.
15
+ - Launch Scrypted Debugger from the launch menu.
package/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # scrypted-tuya
2
+
3
+ Unofficial standalone fork of the Tuya plugin from the [Scrypted repository](https://github.com/koush/scrypted), extracted from [`plugins/tuya`](https://github.com/koush/scrypted/tree/main/plugins/tuya).
4
+
5
+ The standalone extraction is based on upstream commit [`abd37e416dba4e36bcf9768ab6bbf1e82a206dd9`](https://github.com/koush/scrypted/commit/abd37e416dba4e36bcf9768ab6bbf1e82a206dd9). This repository contains only the Tuya plugin and does not include the rest of the Scrypted monorepository.
6
+
7
+ This project is unofficial and is not affiliated with or endorsed by Scrypted or Tuya.
8
+
9
+ ## What changed
10
+
11
+ The upstream plugin requests a cloud RTSP stream from Tuya. For some cameras, Tuya returns the SD profile even when the camera also supports HD.
12
+
13
+ This fork checks the writable device capabilities advertised through the Tuya Sharing API before allocating the RTSP stream. If the camera exposes a video `quality`, `resolution`, `clarity`, `definition`, or `stream_quality` enum, the plugin requests the highest recognised value advertised by that camera.
14
+
15
+ Recognised values include common profiles such as:
16
+
17
+ - `hd`, `high`, `1080p`, and Tuya clarity value `4`;
18
+ - `2k`, `ultra`, `uhd`, and `4k`;
19
+ - lower profiles such as `sd`, `standard`, `720p`, and Tuya clarity value `2` are used only when no higher advertised option exists.
20
+
21
+ Unknown data points and values are not guessed. If the camera does not advertise a writable quality capability, or rejects the command, the plugin safely falls back to the RTSP quality selected by Tuya.
22
+
23
+ ## Important limitation
24
+
25
+ Tuya's documented cloud RTSP allocation endpoint exposes the stream transport, such as RTSP or HLS, but does not expose a documented quality selector. Consequently, this fork can request maximum quality only on cameras that advertise a writable quality-related data point through the Sharing API.
26
+
27
+ Some models control HD exclusively through Tuya's P2P IPC SDK. Those cameras may still return an SD cloud RTSP stream. Check the actual stream resolution on the target camera after installation.
28
+
29
+ ## Features
30
+
31
+ - Tuya and Smart Life camera discovery.
32
+ - Cloud RTSP camera streaming.
33
+ - Maximum advertised video-quality selection with safe fallback.
34
+ - Tuya doorbell ring notifications.
35
+ - Motion events on supported devices.
36
+ - Camera indicator and floodlight controls when exposed by the device.
37
+
38
+ ## Authentication
39
+
40
+ The recommended login method is the QR-code flow using the Tuya or Smart Life application. The legacy Tuya Developer Account login remains available for existing configurations.
41
+
42
+ ## Development
43
+
44
+ Requirements:
45
+
46
+ - Node.js
47
+ - npm
48
+ - a Scrypted server for deployment and runtime testing
49
+
50
+ Install dependencies and verify the project:
51
+
52
+ ```bash
53
+ npm ci
54
+ npm run typecheck
55
+ npm run build
56
+ ```
57
+
58
+ The Scrypted plugin archive is generated at:
59
+
60
+ ```text
61
+ out/plugin.zip
62
+ ```
63
+
64
+ Quality-selection tests are located in `tests/quality.test.ts` and can be run with Bun:
65
+
66
+ ```bash
67
+ bun test tests/quality.test.ts
68
+ ```
69
+
70
+ ## Repository history
71
+
72
+ This repository is a standalone extraction rather than a GitHub network fork because GitHub cannot fork a single subdirectory of a monorepository. Upstream provenance is recorded in `STANDALONE-NOTICE.md` and `UPSTREAM-LICENSE-NOTICE.md`.
73
+
74
+ ## License and attribution
75
+
76
+ The upstream Scrypted repository uses directory-specific licensing and does not declare a conventional SPDX license specifically for `plugins/tuya`. The original upstream notice is preserved in `UPSTREAM-LICENSE-NOTICE.md`.
77
+
78
+ Review the upstream terms and obtain any required permission before redistributing this fork or publishing derived packages. Copyright remains with the original contributors.
@@ -0,0 +1,5 @@
1
+ # Standalone extraction notice
2
+
3
+ Unofficial standalone extraction of `plugins/tuya` from https://github.com/koush/scrypted.
4
+ Snapshot: `abd37e416dba4e36bcf9768ab6bbf1e82a206dd9`.
5
+ Only the Tuya plugin is included. Review `UPSTREAM-LICENSE-NOTICE.md` before redistribution.
@@ -0,0 +1,3 @@
1
+ # License
2
+
3
+ See individual project directories for licensing, as it will vary throughout the repository. Some plugins may have dependencies that require GPL compliance.
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * mime-db
3
+ * Copyright(c) 2014 Jonathan Ong
4
+ * Copyright(c) 2015-2022 Douglas Christopher Wilson
5
+ * MIT Licensed
6
+ */
7
+
8
+ /*!
9
+ * mime-types
10
+ * Copyright(c) 2014 Jonathan Ong
11
+ * Copyright(c) 2015 Douglas Christopher Wilson
12
+ * MIT Licensed
13
+ */
14
+
15
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
Binary file
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "scrypted-tuya",
3
+ "scripts": {
4
+ "scrypted-setup-project": "scrypted-setup-project",
5
+ "prescrypted-setup-project": "scrypted-package-json",
6
+ "build": "scrypted-webpack",
7
+ "typecheck": "tsc --noEmit",
8
+ "prepublishOnly": "WEBPACK_DEVTOOL=nosources-source-map NODE_ENV=production scrypted-webpack",
9
+ "prescrypted-vscode-launch": "WEBPACK_DEVTOOL=nosources-source-map scrypted-webpack",
10
+ "scrypted-vscode-launch": "scrypted-deploy-debug",
11
+ "scrypted-deploy-debug": "scrypted-deploy-debug",
12
+ "scrypted-debug": "scrypted-debug",
13
+ "scrypted-deploy": "scrypted-deploy",
14
+ "scrypted-changelog": "scrypted-changelog",
15
+ "scrypted-package-json": "scrypted-package-json",
16
+ "scrypted-readme": "scrypted-readme"
17
+ },
18
+ "keywords": [
19
+ "scrypted",
20
+ "plugin",
21
+ "tuya",
22
+ "camera"
23
+ ],
24
+ "scrypted": {
25
+ "name": "Tuya Plugin",
26
+ "type": "DeviceProvider",
27
+ "interfaces": [
28
+ "DeviceProvider",
29
+ "Settings"
30
+ ]
31
+ },
32
+ "dependencies": {
33
+ "@scrypted/sdk": "^0.3.88",
34
+ "axios": "^1.8.4",
35
+ "mqtt": "^5.10.4",
36
+ "qrcode-svg": "^1.1.0"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^22.10.2",
40
+ "@types/qrcode": "^1.5.5",
41
+ "@types/qrcode-svg": "^1.1.5",
42
+ "@types/ws": "^8.18.0"
43
+ },
44
+ "version": "0.1.0-beta.9",
45
+ "packageManager": "npm@10.9.2+sha512.8ab88f10f224a0c614cb717a7f7c30499014f77134120e9c1f0211ea3cf3397592cbe483feb38e0c4b3be1c54e347292c76a1b5edb94a3289d5448484ab8ac81",
46
+ "description": "Unofficial standalone Scrypted Tuya plugin with maximum advertised camera quality selection.",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/resonaura/scrypted-tuya.git"
50
+ },
51
+ "homepage": "https://github.com/resonaura/scrypted-tuya#readme",
52
+ "bugs": {
53
+ "url": "https://github.com/resonaura/scrypted-tuya/issues"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public",
57
+ "tag": "beta"
58
+ }
59
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "moduleResolution": "bundler",
5
+ "module": "ESNext",
6
+ "strict": true,
7
+ "sourceMap": true,
8
+ "resolveJsonModule": true,
9
+ "esModuleInterop": true,
10
+ "allowSyntheticDefaultImports": true,
11
+ "skipLibCheck": true
12
+ },
13
+ "include": [
14
+ "src/**/*"
15
+ ]
16
+ }