@camera.ui/camera-ui-eufy 0.0.20 → 0.0.21
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/bundle.zip +0 -0
- package/package.json +16 -27
- package/CHANGELOG.md +0 -8
- package/CONTRIBUTING.md +0 -1
- package/LICENSE.md +0 -22
- package/README.md +0 -1
- package/config.schema.json +0 -356
- package/dist/camera.d.ts +0 -23
- package/dist/camera.js +0 -132
- package/dist/camera.js.map +0 -1
- package/dist/eufy/LocalLiveStreamManager.d.ts +0 -31
- package/dist/eufy/LocalLiveStreamManager.js +0 -111
- package/dist/eufy/LocalLiveStreamManager.js.map +0 -1
- package/dist/eufy/Talkback.d.ts +0 -23
- package/dist/eufy/Talkback.js +0 -93
- package/dist/eufy/Talkback.js.map +0 -1
- package/dist/eufy/utils.d.ts +0 -22
- package/dist/eufy/utils.js +0 -102
- package/dist/eufy/utils.js.map +0 -1
- package/dist/index.d.ts +0 -31
- package/dist/index.js +0 -419
- package/dist/index.js.map +0 -1
- package/dist/types.d.ts +0 -37
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -3
- package/dist/utils.js +0 -262
- package/dist/utils.js.map +0 -1
package/bundle.zip
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,45 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "Eufy",
|
|
3
3
|
"name": "@camera.ui/camera-ui-eufy",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.21",
|
|
5
5
|
"description": "camera.ui eufy plugin",
|
|
6
6
|
"author": "seydx (https://github.com/seydx/camera.ui)",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
|
-
"type": "
|
|
8
|
+
"type": "commonjs",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "rimraf dist && tsc",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"update": "updates --update ./",
|
|
11
|
+
"bundle": "npm run format && npm run lint && npm run build && cui bundle",
|
|
12
|
+
"format": "prettier --write \"src/\" --ignore-unknown --no-error-on-unmatched-pattern",
|
|
14
13
|
"install-updates": "npm i --save",
|
|
15
|
-
"
|
|
14
|
+
"lint": "eslint .",
|
|
15
|
+
"lint:fix": "eslint --fix .",
|
|
16
|
+
"prepublishOnly": "node -e \"if(!process.env.SAFE_PUBLISH){console.error('Error: Please use @camera.ui/cli to publish the plugin:\\n npm run publish:alpha\\n npm run publish:beta\\n npm run publish:latest\\n');process.exit(1)}\"",
|
|
17
|
+
"publish:alpha": "cui publish --alpha",
|
|
18
|
+
"publish:beta": "cui publish --beta",
|
|
19
|
+
"publish:latest": "cui publish --latest",
|
|
20
|
+
"update": "updates --update ./"
|
|
16
21
|
},
|
|
17
22
|
"dependencies": {
|
|
18
|
-
"@camera.ui/rtsp": "^0.0.40",
|
|
19
23
|
"eufy-security-client": "^3.1.1"
|
|
20
24
|
},
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@camera.ui/types": "^0.0.77",
|
|
23
|
-
"@rushstack/eslint-patch": "^1.10.4",
|
|
24
|
-
"@types/node": "^22.7.6",
|
|
25
|
-
"@types/ws": "^8.5.12",
|
|
26
|
-
"@typescript-eslint/eslint-plugin": "^8.10.0",
|
|
27
|
-
"@typescript-eslint/parser": "^8.10.0",
|
|
28
|
-
"concurrently": "^9.0.1",
|
|
29
|
-
"eslint": "8.57.0",
|
|
30
|
-
"eslint-config-prettier": "^9.1.0",
|
|
31
|
-
"eslint-plugin-prettier": "^5.2.1",
|
|
32
|
-
"prettier": "^3.3.3",
|
|
33
|
-
"rimraf": "^6.0.1",
|
|
34
|
-
"typescript": "^5.6.3",
|
|
35
|
-
"updates": "^16.4.0"
|
|
36
|
-
},
|
|
37
25
|
"bugs": {
|
|
38
26
|
"url": "https://github.com/seydx/camera.ui/issues"
|
|
39
27
|
},
|
|
40
28
|
"engines": {
|
|
41
|
-
"camera.ui": ">=0.0.34-alpha.
|
|
42
|
-
"node": ">=20.
|
|
29
|
+
"camera.ui": ">=0.0.34-alpha.4",
|
|
30
|
+
"node": ">=20.18.0"
|
|
43
31
|
},
|
|
44
32
|
"homepage": "https://github.com/seydx/camera.ui#readme",
|
|
45
33
|
"keywords": [
|
|
@@ -61,6 +49,7 @@
|
|
|
61
49
|
"dependencies": [],
|
|
62
50
|
"options": {
|
|
63
51
|
"extendedMotionDetection": false
|
|
64
|
-
}
|
|
52
|
+
},
|
|
53
|
+
"bundled": true
|
|
65
54
|
}
|
|
66
|
-
}
|
|
55
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
All notable changes to this project will be documented in this file.
|
|
2
|
-
|
|
3
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
4
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
|
-
|
|
6
|
-
## [X.X.X] - ???
|
|
7
|
-
|
|
8
|
-
- Initial Release
|
package/CONTRIBUTING.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Contributing
|
package/LICENSE.md
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023-2024 seydx <dev@seydx.com>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
a copy of this software and associated documentation files (the
|
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
-
the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
|
14
|
-
included in all copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# @camera.ui/camera-ui-eufy
|
package/config.schema.json
DELETED
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema": {
|
|
3
|
-
"homes": {
|
|
4
|
-
"type": "array",
|
|
5
|
-
"key": "homes",
|
|
6
|
-
"title": "Homes",
|
|
7
|
-
"description": "Eufy Homes",
|
|
8
|
-
"items": {
|
|
9
|
-
"type": "object",
|
|
10
|
-
"title": "Home",
|
|
11
|
-
"description": "Eufy Home",
|
|
12
|
-
"required": true,
|
|
13
|
-
"properties": {
|
|
14
|
-
"debug": {
|
|
15
|
-
"type": "boolean",
|
|
16
|
-
"title": "Debug",
|
|
17
|
-
"description": "Enable debug mode",
|
|
18
|
-
"required": false,
|
|
19
|
-
"defaultValue": false,
|
|
20
|
-
"store": true
|
|
21
|
-
},
|
|
22
|
-
"name": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"title": "Home Name",
|
|
25
|
-
"description": "Name of the home",
|
|
26
|
-
"required": true,
|
|
27
|
-
"store": true
|
|
28
|
-
},
|
|
29
|
-
"username": {
|
|
30
|
-
"type": "string",
|
|
31
|
-
"title": "Login Email",
|
|
32
|
-
"description": "Email for the login",
|
|
33
|
-
"format": "email",
|
|
34
|
-
"required": true,
|
|
35
|
-
"store": true
|
|
36
|
-
},
|
|
37
|
-
"password": {
|
|
38
|
-
"type": "string",
|
|
39
|
-
"title": "Login Password",
|
|
40
|
-
"description": "Password for the login",
|
|
41
|
-
"format": "password",
|
|
42
|
-
"required": true,
|
|
43
|
-
"store": true
|
|
44
|
-
},
|
|
45
|
-
"country": {
|
|
46
|
-
"type": "string",
|
|
47
|
-
"title": "Country",
|
|
48
|
-
"description": "Country for the login",
|
|
49
|
-
"required": false,
|
|
50
|
-
"store": true,
|
|
51
|
-
"defaultValue": "United States",
|
|
52
|
-
"enum": [
|
|
53
|
-
"Afghanistan",
|
|
54
|
-
"Aland Islands",
|
|
55
|
-
"Albania",
|
|
56
|
-
"Algeria",
|
|
57
|
-
"American Samoa",
|
|
58
|
-
"Andorra",
|
|
59
|
-
"Angola",
|
|
60
|
-
"Anguilla",
|
|
61
|
-
"Antarctica",
|
|
62
|
-
"Antigua and Barbuda",
|
|
63
|
-
"Argentina",
|
|
64
|
-
"Armenia",
|
|
65
|
-
"Aruba",
|
|
66
|
-
"Australia",
|
|
67
|
-
"Austria",
|
|
68
|
-
"Azerbaijan",
|
|
69
|
-
"Bahamas",
|
|
70
|
-
"Bahrain",
|
|
71
|
-
"Bangladesh",
|
|
72
|
-
"Barbados",
|
|
73
|
-
"Belarus",
|
|
74
|
-
"Belgium",
|
|
75
|
-
"Belize",
|
|
76
|
-
"Benin",
|
|
77
|
-
"Bermuda",
|
|
78
|
-
"Bhutan",
|
|
79
|
-
"Bolivia",
|
|
80
|
-
"Bonaire, Sint Eustatius and Saba",
|
|
81
|
-
"Bosnia and Herzegovina",
|
|
82
|
-
"Botswana",
|
|
83
|
-
"Bouvet Island",
|
|
84
|
-
"Brazil",
|
|
85
|
-
"British Indian Ocean Territory",
|
|
86
|
-
"Brunei Darussalam",
|
|
87
|
-
"Bulgaria",
|
|
88
|
-
"Burkina Faso",
|
|
89
|
-
"Burundi",
|
|
90
|
-
"Cambodia",
|
|
91
|
-
"Cameroon",
|
|
92
|
-
"Canada",
|
|
93
|
-
"Cape Verde",
|
|
94
|
-
"Cayman Islands",
|
|
95
|
-
"Central African Republic",
|
|
96
|
-
"Chad",
|
|
97
|
-
"Chile",
|
|
98
|
-
"China",
|
|
99
|
-
"Christmas Island",
|
|
100
|
-
"Cocos (Keeling) Islands",
|
|
101
|
-
"Colombia",
|
|
102
|
-
"Comoros",
|
|
103
|
-
"Congo",
|
|
104
|
-
"Congo, the Democratic Republic of the",
|
|
105
|
-
"Cook Islands",
|
|
106
|
-
"Costa Rica",
|
|
107
|
-
"Cote DIvoire",
|
|
108
|
-
"Croatia",
|
|
109
|
-
"Cuba",
|
|
110
|
-
"Curacao",
|
|
111
|
-
"Cyprus",
|
|
112
|
-
"Czech Republic",
|
|
113
|
-
"Denmark",
|
|
114
|
-
"Djibouti",
|
|
115
|
-
"Dominica",
|
|
116
|
-
"Dominican Republic",
|
|
117
|
-
"Ecuador",
|
|
118
|
-
"Egypt",
|
|
119
|
-
"El Salvador",
|
|
120
|
-
"Equatorial Guinea",
|
|
121
|
-
"Eritrea",
|
|
122
|
-
"Estonia",
|
|
123
|
-
"Ethiopia",
|
|
124
|
-
"Falkland Islands (Malvinas)",
|
|
125
|
-
"Faroe Islands",
|
|
126
|
-
"Fiji",
|
|
127
|
-
"Finland",
|
|
128
|
-
"France",
|
|
129
|
-
"French Guiana",
|
|
130
|
-
"French Polynesia",
|
|
131
|
-
"French Southern Territories",
|
|
132
|
-
"Gabon",
|
|
133
|
-
"Gambia",
|
|
134
|
-
"Georgia",
|
|
135
|
-
"Germany",
|
|
136
|
-
"Ghana",
|
|
137
|
-
"Gibraltar",
|
|
138
|
-
"Greece",
|
|
139
|
-
"Greenland",
|
|
140
|
-
"Grenada",
|
|
141
|
-
"Guadeloupe",
|
|
142
|
-
"Guam",
|
|
143
|
-
"Guatemala",
|
|
144
|
-
"Guernsey",
|
|
145
|
-
"Guinea",
|
|
146
|
-
"Guinea-Bissau",
|
|
147
|
-
"Guyana",
|
|
148
|
-
"Haiti",
|
|
149
|
-
"Heard Island and Mcdonald Islands",
|
|
150
|
-
"Holy See (Vatican City State)",
|
|
151
|
-
"Honduras",
|
|
152
|
-
"Hong Kong",
|
|
153
|
-
"Hungary",
|
|
154
|
-
"Iceland",
|
|
155
|
-
"India",
|
|
156
|
-
"Indonesia",
|
|
157
|
-
"Iran, Islamic Republic of",
|
|
158
|
-
"Iraq",
|
|
159
|
-
"Ireland",
|
|
160
|
-
"Isle of Man",
|
|
161
|
-
"Israel",
|
|
162
|
-
"Italy",
|
|
163
|
-
"Jamaica",
|
|
164
|
-
"Japan",
|
|
165
|
-
"Jersey",
|
|
166
|
-
"Jordan",
|
|
167
|
-
"Kazakhstan",
|
|
168
|
-
"Kenya",
|
|
169
|
-
"Kiribati",
|
|
170
|
-
"Korea, Democratic Peoples Republic of",
|
|
171
|
-
"Korea, Republic of",
|
|
172
|
-
"Kosovo",
|
|
173
|
-
"Kuwait",
|
|
174
|
-
"Kyrgyzstan",
|
|
175
|
-
"Lao Peoples Democratic Republic",
|
|
176
|
-
"Latvia",
|
|
177
|
-
"Lebanon",
|
|
178
|
-
"Lesotho",
|
|
179
|
-
"Liberia",
|
|
180
|
-
"Libyan Arab Jamahiriya",
|
|
181
|
-
"Liechtenstein",
|
|
182
|
-
"Lithuania",
|
|
183
|
-
"Luxembourg",
|
|
184
|
-
"Macao",
|
|
185
|
-
"Macedonia, the Former Yugoslav Republic of",
|
|
186
|
-
"Madagascar",
|
|
187
|
-
"Malawi",
|
|
188
|
-
"Malaysia",
|
|
189
|
-
"Maldives",
|
|
190
|
-
"Mali",
|
|
191
|
-
"Malta",
|
|
192
|
-
"Marshall Islands",
|
|
193
|
-
"Martinique",
|
|
194
|
-
"Mauritania",
|
|
195
|
-
"Mauritius",
|
|
196
|
-
"Mayotte",
|
|
197
|
-
"Mexico",
|
|
198
|
-
"Micronesia, Federated States of",
|
|
199
|
-
"Moldova, Republic of",
|
|
200
|
-
"Monaco",
|
|
201
|
-
"Mongolia",
|
|
202
|
-
"Montenegro",
|
|
203
|
-
"Montserrat",
|
|
204
|
-
"Morocco",
|
|
205
|
-
"Mozambique",
|
|
206
|
-
"Myanmar",
|
|
207
|
-
"Namibia",
|
|
208
|
-
"Nauru",
|
|
209
|
-
"Nepal",
|
|
210
|
-
"Netherlands",
|
|
211
|
-
"Netherlands Antilles",
|
|
212
|
-
"New Caledonia",
|
|
213
|
-
"New Zealand",
|
|
214
|
-
"Nicaragua",
|
|
215
|
-
"Niger",
|
|
216
|
-
"Nigeria",
|
|
217
|
-
"Niue",
|
|
218
|
-
"Norfolk Island",
|
|
219
|
-
"Northern Mariana Islands",
|
|
220
|
-
"Norway",
|
|
221
|
-
"Oman",
|
|
222
|
-
"Pakistan",
|
|
223
|
-
"Palau",
|
|
224
|
-
"Palestinian Territory, Occupied",
|
|
225
|
-
"Panama",
|
|
226
|
-
"Papua New Guinea",
|
|
227
|
-
"Paraguay",
|
|
228
|
-
"Peru",
|
|
229
|
-
"Philippines",
|
|
230
|
-
"Pitcairn",
|
|
231
|
-
"Poland",
|
|
232
|
-
"Portugal",
|
|
233
|
-
"Puerto Rico",
|
|
234
|
-
"Qatar",
|
|
235
|
-
"Reunion",
|
|
236
|
-
"Romania",
|
|
237
|
-
"Russian Federation",
|
|
238
|
-
"Rwanda",
|
|
239
|
-
"Saint Barthelemy",
|
|
240
|
-
"Saint Helena",
|
|
241
|
-
"Saint Kitts and Nevis",
|
|
242
|
-
"Saint Lucia",
|
|
243
|
-
"Saint Martin",
|
|
244
|
-
"Saint Pierre and Miquelon",
|
|
245
|
-
"Saint Vincent and the Grenadines",
|
|
246
|
-
"Samoa",
|
|
247
|
-
"San Marino",
|
|
248
|
-
"Sao Tome and Principe",
|
|
249
|
-
"Saudi Arabia",
|
|
250
|
-
"Senegal",
|
|
251
|
-
"Serbia",
|
|
252
|
-
"Serbia and Montenegro",
|
|
253
|
-
"Seychelles",
|
|
254
|
-
"Sierra Leone",
|
|
255
|
-
"Singapore",
|
|
256
|
-
"Sint Maarten",
|
|
257
|
-
"Slovakia",
|
|
258
|
-
"Slovenia",
|
|
259
|
-
"Solomon Islands",
|
|
260
|
-
"Somalia",
|
|
261
|
-
"South Africa",
|
|
262
|
-
"South Georgia and the South Sandwich Islands",
|
|
263
|
-
"South Sudan",
|
|
264
|
-
"Spain",
|
|
265
|
-
"Sri Lanka",
|
|
266
|
-
"Sudan",
|
|
267
|
-
"Suriname",
|
|
268
|
-
"Svalbard and Jan Mayen",
|
|
269
|
-
"Swaziland",
|
|
270
|
-
"Sweden",
|
|
271
|
-
"Switzerland",
|
|
272
|
-
"Syrian Arab Republic",
|
|
273
|
-
"Taiwan, Province of China",
|
|
274
|
-
"Tajikistan",
|
|
275
|
-
"Tanzania, United Republic of",
|
|
276
|
-
"Thailand",
|
|
277
|
-
"Timor-Leste",
|
|
278
|
-
"Togo",
|
|
279
|
-
"Tokelau",
|
|
280
|
-
"Tonga",
|
|
281
|
-
"Trinidad and Tobago",
|
|
282
|
-
"Tunisia",
|
|
283
|
-
"Turk",
|
|
284
|
-
"Turkmenistan",
|
|
285
|
-
"Turks and Caicos Islands",
|
|
286
|
-
"Tuvalu",
|
|
287
|
-
"Uganda",
|
|
288
|
-
"Ukraine",
|
|
289
|
-
"United Arab Emirates",
|
|
290
|
-
"United Kingdom",
|
|
291
|
-
"United States",
|
|
292
|
-
"United States Minor Outlying Islands",
|
|
293
|
-
"Uruguay",
|
|
294
|
-
"Uzbekistan",
|
|
295
|
-
"Vanuatu",
|
|
296
|
-
"Venezuela",
|
|
297
|
-
"Viet Nam",
|
|
298
|
-
"Virgin Islands, British",
|
|
299
|
-
"Virgin Islands, U.s.",
|
|
300
|
-
"Wallis and Futuna",
|
|
301
|
-
"Western Sahara",
|
|
302
|
-
"Yemen",
|
|
303
|
-
"Zambia",
|
|
304
|
-
"Zimbabwe"
|
|
305
|
-
]
|
|
306
|
-
},
|
|
307
|
-
"deviceName": {
|
|
308
|
-
"type": "string",
|
|
309
|
-
"title": "Device Name",
|
|
310
|
-
"description": "Name of the device",
|
|
311
|
-
"required": false,
|
|
312
|
-
"defaultValue": "camera.ui",
|
|
313
|
-
"store": true
|
|
314
|
-
},
|
|
315
|
-
"useP2P": {
|
|
316
|
-
"type": "boolean",
|
|
317
|
-
"title": "Use P2P",
|
|
318
|
-
"description": "Use P2P for live stream",
|
|
319
|
-
"required": false,
|
|
320
|
-
"defaultValue": false,
|
|
321
|
-
"store": true
|
|
322
|
-
},
|
|
323
|
-
"maxLiveStreamDuration": {
|
|
324
|
-
"type": "number",
|
|
325
|
-
"title": "Max Live Stream Duration",
|
|
326
|
-
"description": "Max duration of live stream in seconds",
|
|
327
|
-
"required": false,
|
|
328
|
-
"defaultValue": 86400,
|
|
329
|
-
"minimum": 60,
|
|
330
|
-
"maximum": 86400,
|
|
331
|
-
"store": true
|
|
332
|
-
},
|
|
333
|
-
"ignoreDevices": {
|
|
334
|
-
"type": "array",
|
|
335
|
-
"title": "Ignore Devices",
|
|
336
|
-
"description": "List of devices to ignore",
|
|
337
|
-
"required": false,
|
|
338
|
-
"items": {
|
|
339
|
-
"type": "string",
|
|
340
|
-
"title": "Device",
|
|
341
|
-
"description": "Device to ignore"
|
|
342
|
-
},
|
|
343
|
-
"defaultValue": [],
|
|
344
|
-
"store": true
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
"buttons": [
|
|
348
|
-
{
|
|
349
|
-
"label": "Login",
|
|
350
|
-
"onSubmit": "onLogin"
|
|
351
|
-
}
|
|
352
|
-
]
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
package/dist/camera.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { CameraDelegate, CameraDevice, LoggerService } from '@camera.ui/types';
|
|
2
|
-
import type { Camera as EufyCamera, EufySecurity } from 'eufy-security-client';
|
|
3
|
-
import type Eufy from './index.js';
|
|
4
|
-
import type { EufyHome } from './types.js';
|
|
5
|
-
export declare class Camera implements CameraDelegate {
|
|
6
|
-
cameraDevice: CameraDevice;
|
|
7
|
-
private platform;
|
|
8
|
-
private home;
|
|
9
|
-
private eufyClient;
|
|
10
|
-
private eufyDevice;
|
|
11
|
-
private pluginLogger;
|
|
12
|
-
private cameraLogger;
|
|
13
|
-
private ffmpegPath?;
|
|
14
|
-
private rtspServer;
|
|
15
|
-
private localLivestreamManager;
|
|
16
|
-
private talkbackStream;
|
|
17
|
-
constructor(platform: Eufy, home: EufyHome, eufyClient: EufySecurity, eufyDevice: EufyCamera, logger: LoggerService);
|
|
18
|
-
createCameraDevice(): Promise<void>;
|
|
19
|
-
snapshot(): Promise<ArrayBuffer | undefined>;
|
|
20
|
-
reboot(): Promise<void>;
|
|
21
|
-
private createRTSPServer;
|
|
22
|
-
private checkStates;
|
|
23
|
-
}
|
package/dist/camera.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { RTSPSingleServer } from '@camera.ui/rtsp';
|
|
2
|
-
import { PropertyName } from 'eufy-security-client';
|
|
3
|
-
import { LocalLivestreamManager } from './eufy/LocalLiveStreamManager.js';
|
|
4
|
-
import { TalkbackStream } from './eufy/Talkback.js';
|
|
5
|
-
export class Camera {
|
|
6
|
-
cameraDevice;
|
|
7
|
-
platform;
|
|
8
|
-
home;
|
|
9
|
-
eufyClient;
|
|
10
|
-
eufyDevice;
|
|
11
|
-
pluginLogger;
|
|
12
|
-
cameraLogger;
|
|
13
|
-
ffmpegPath;
|
|
14
|
-
rtspServer;
|
|
15
|
-
localLivestreamManager;
|
|
16
|
-
talkbackStream;
|
|
17
|
-
constructor(platform, home, eufyClient, eufyDevice, logger) {
|
|
18
|
-
this.platform = platform;
|
|
19
|
-
this.home = home;
|
|
20
|
-
this.eufyClient = eufyClient;
|
|
21
|
-
this.eufyDevice = eufyDevice;
|
|
22
|
-
this.pluginLogger = logger;
|
|
23
|
-
this.cameraLogger = logger;
|
|
24
|
-
}
|
|
25
|
-
async createCameraDevice() {
|
|
26
|
-
await this.createRTSPServer();
|
|
27
|
-
const sourceName = 'P2P';
|
|
28
|
-
const streamUrls = [this.rtspServer.streamUrl];
|
|
29
|
-
// const streamUrls = [`ffmpeg:${this.rtspServer.streamUrl}#video=copy#audio=opus`];
|
|
30
|
-
// const streamUrls = [this.rtspServer.streamUrl, `ffmpeg:${transcodedSourceName}#video=copy#audio=opus`];
|
|
31
|
-
const cameraDevice = Array.from(this.platform.cameras.values()).find((camera) => camera.nativeId === this.eufyDevice.getSerial());
|
|
32
|
-
if (!cameraDevice) {
|
|
33
|
-
this.pluginLogger.log(this.home.name, 'Adding camera', this.eufyDevice.getName());
|
|
34
|
-
this.cameraDevice = await this.platform.api.deviceManager.createCamera({
|
|
35
|
-
name: this.eufyDevice.getName(),
|
|
36
|
-
nativeId: this.eufyDevice.getSerial(),
|
|
37
|
-
hasBattery: this.eufyDevice.hasBattery(),
|
|
38
|
-
info: {
|
|
39
|
-
manufacturer: 'Eufy',
|
|
40
|
-
model: this.eufyDevice.getModel(),
|
|
41
|
-
hardware: this.eufyDevice.getHardwareVersion(),
|
|
42
|
-
serialNumber: this.eufyDevice.getSerial(),
|
|
43
|
-
firmwareVersion: this.eufyDevice.getSoftwareVersion(),
|
|
44
|
-
supportUrl: 'https://support.eufy.com/',
|
|
45
|
-
},
|
|
46
|
-
sources: [
|
|
47
|
-
{
|
|
48
|
-
name: sourceName,
|
|
49
|
-
roles: ['high-resolution', 'snapshot'],
|
|
50
|
-
urls: streamUrls,
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
this.cameraDevice = cameraDevice;
|
|
57
|
-
await this.cameraDevice.updateCameraSource(cameraDevice.streamSource._id, { urls: streamUrls });
|
|
58
|
-
}
|
|
59
|
-
this.cameraDevice.setDelegate('cameraDelegate', this);
|
|
60
|
-
this.cameraLogger = this.cameraDevice.logger;
|
|
61
|
-
this.localLivestreamManager = new LocalLivestreamManager(this.home, this.eufyClient, this.eufyDevice, this.cameraDevice, this.cameraLogger);
|
|
62
|
-
this.talkbackStream = new TalkbackStream(this.home, this.eufyClient, this.eufyDevice, this.cameraDevice, this.cameraLogger);
|
|
63
|
-
const ffmpegPath = await this.platform.api.coreManager.getFFmpegPath();
|
|
64
|
-
this.rtspServer.changeFFmpegPath(ffmpegPath);
|
|
65
|
-
await this.cameraDevice.connect();
|
|
66
|
-
this.checkStates();
|
|
67
|
-
}
|
|
68
|
-
async snapshot() {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
async reboot() {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
async createRTSPServer() {
|
|
75
|
-
let stream;
|
|
76
|
-
if (this.home.useP2P) {
|
|
77
|
-
stream = {
|
|
78
|
-
name: 'Eufy',
|
|
79
|
-
addBackchannel: true,
|
|
80
|
-
ffmpegArgs: {
|
|
81
|
-
inputArgs: ['-f', 'h264', '-i', 'pipe:3', '-f', 'aac', '-i', 'pipe:4'],
|
|
82
|
-
audioEncoderArgs: ['-acodec', 'libopus', '-application:a', 'lowdelay', '-min_comp', '0'],
|
|
83
|
-
videoEncoderArgs: ['-vcodec', 'copy'],
|
|
84
|
-
},
|
|
85
|
-
ffmpegTalkbackArgs: {
|
|
86
|
-
audioEncoderArgs: ['-acodec', 'libfdk_aac', '-ac', '2', '-ar', '16k', '-b:a', '20k', '-f', 'adts'],
|
|
87
|
-
outputArgs: ['-'],
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
stream = {
|
|
93
|
-
name: 'Eufy',
|
|
94
|
-
url: async () => {
|
|
95
|
-
return this.eufyDevice.getPropertyValue(PropertyName.DeviceRTSPStreamUrl);
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
const rtspLogger = {
|
|
100
|
-
// log: this.cameraLogger.log.bind(this.logger),
|
|
101
|
-
warn: this.cameraLogger.warn.bind(this.cameraLogger),
|
|
102
|
-
error: this.cameraLogger.error.bind(this.cameraLogger),
|
|
103
|
-
// debug: this.cameraLogger.trace.bind(this.logger),
|
|
104
|
-
};
|
|
105
|
-
this.rtspServer = await RTSPSingleServer.initialize({ stream }, rtspLogger);
|
|
106
|
-
await this.rtspServer.listen();
|
|
107
|
-
if (this.home.useP2P) {
|
|
108
|
-
const client = this.rtspServer.getClient();
|
|
109
|
-
client.onStreamStarted.subscribe(async (streamProcess) => {
|
|
110
|
-
try {
|
|
111
|
-
const stationStream = await this.localLivestreamManager.getLocalLivestream();
|
|
112
|
-
stationStream.videostream.pipe(streamProcess.cp.stdio[4]);
|
|
113
|
-
stationStream.audiostream.pipe(streamProcess.cp.stdio[5]);
|
|
114
|
-
}
|
|
115
|
-
catch (error) {
|
|
116
|
-
this.cameraLogger.error(this.home.name, 'Failed to start local livestream:', error);
|
|
117
|
-
streamProcess.kill();
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
client.onStreamStopped.subscribe(() => {
|
|
121
|
-
this.localLivestreamManager.stopLocalLiveStream();
|
|
122
|
-
});
|
|
123
|
-
client.onTalkbackProcessStarted.subscribe((talkbackProcess) => {
|
|
124
|
-
talkbackProcess.cp.stdout?.pipe(this.talkbackStream);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
checkStates() {
|
|
129
|
-
this.cameraLogger.debug('Checking states...');
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
//# sourceMappingURL=camera.js.map
|
package/dist/camera.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"camera.js","sourceRoot":"","sources":["../src/camera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAS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,EAAE,mCAAmC,EAAE,KAAK,CAAC,CAAC;oBACpF,aAAa,CAAC,IAAI,EAAE,CAAC;gBACvB,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,EAAE;gBACpC,IAAI,CAAC,sBAAsB,CAAC,mBAAmB,EAAE,CAAC;YACpD,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,eAAe,EAAE,EAAE;gBAC5D,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAChD,CAAC;CACF"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'node:events';
|
|
2
|
-
import type { CameraDevice, LoggerService } from '@camera.ui/types';
|
|
3
|
-
import type { Device, EufySecurity, Station, StreamMetadata } from 'eufy-security-client';
|
|
4
|
-
import type { Readable } from 'node:stream';
|
|
5
|
-
import type { EufyHome } from '../types.js';
|
|
6
|
-
export type StationStream = {
|
|
7
|
-
station: Station;
|
|
8
|
-
device: Device;
|
|
9
|
-
metadata: StreamMetadata;
|
|
10
|
-
videostream: Readable;
|
|
11
|
-
audiostream: Readable;
|
|
12
|
-
createdAt: number;
|
|
13
|
-
};
|
|
14
|
-
export declare class LocalLivestreamManager extends EventEmitter {
|
|
15
|
-
private readonly CONNECTION_ESTABLISHED_TIMEOUT;
|
|
16
|
-
private stationStream;
|
|
17
|
-
private livestreamStartedAt;
|
|
18
|
-
private livestreamIsStarting;
|
|
19
|
-
private eufyClient;
|
|
20
|
-
private cameraDevice;
|
|
21
|
-
private home;
|
|
22
|
-
private cameraLogger;
|
|
23
|
-
private serial_number;
|
|
24
|
-
constructor(home: EufyHome, eufyClient: EufySecurity, eufyDevice: Device, cameraDevice: CameraDevice, cameraLogger: LoggerService);
|
|
25
|
-
private initialize;
|
|
26
|
-
getLocalLivestream(): Promise<StationStream>;
|
|
27
|
-
private startAndGetLocalLiveStream;
|
|
28
|
-
stopLocalLiveStream(): void;
|
|
29
|
-
private onStationLivestreamStop;
|
|
30
|
-
private onStationLivestreamStart;
|
|
31
|
-
}
|