diff --git a/plugins/alexa/CHANGELOG.md b/plugins/alexa/CHANGELOG.md index 20876a8d18..20a0ce5d8d 100644 --- a/plugins/alexa/CHANGELOG.md +++ b/plugins/alexa/CHANGELOG.md @@ -1,6 +1,16 @@
Changelog +### 0.3.4 + +Alexa: add option to not auto enable devices (#1615) + + +### 0.3.3 + +google-home/alexa: republish with new sdk for media converter + + ### 0.3.2 alexa: fix syncedDevices being undefined diff --git a/plugins/alexa/package-lock.json b/plugins/alexa/package-lock.json index a609cc1015..8cb4738f6a 100644 --- a/plugins/alexa/package-lock.json +++ b/plugins/alexa/package-lock.json @@ -1,11 +1,12 @@ { "name": "@scrypted/alexa", + "version": "0.3.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@scrypted/alexa", - "version": "0.3.4", + "version": "0.3.6", "dependencies": { "axios": "^1.3.4", "uuid": "^9.0.0" @@ -24,35 +25,41 @@ "license": "ISC", "dependencies": { "@scrypted/sdk": "file:../sdk", - "@scrypted/server": "file:../server", "http-auth-utils": "^5.0.1", - "typescript": "^5.3.3" + "typescript": "^5.5.3" }, "devDependencies": { "@types/node": "^20.11.0", + "monaco-editor": "^0.50.0", "ts-node": "^10.9.2" } }, "../../sdk": { "name": "@scrypted/sdk", - "version": "0.3.5", + "version": "0.3.113", "dev": true, "license": "ISC", "dependencies": { - "@babel/preset-typescript": "^7.18.6", - "adm-zip": "^0.4.13", - "axios": "^1.6.5", - "babel-loader": "^9.1.0", - "babel-plugin-const-enum": "^1.1.0", - "esbuild": "^0.15.9", + "@babel/preset-typescript": "^7.26.0", + "@rollup/plugin-commonjs": "^28.0.1", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.3.0", + "@rollup/plugin-typescript": "^12.1.1", + "@rollup/plugin-virtual": "^3.0.2", + "adm-zip": "^0.5.16", + "axios": "^1.7.8", + "babel-loader": "^9.2.1", + "babel-plugin-const-enum": "^1.2.0", "ncp": "^2.0.0", "raw-loader": "^4.0.2", - "rimraf": "^3.0.2", - "tmp": "^0.2.1", - "ts-loader": "^9.4.2", - "typescript": "^4.9.4", - "webpack": "^5.75.0", - "webpack-bundle-analyzer": "^4.5.0" + "rimraf": "^6.0.1", + "rollup": "^4.27.4", + "tmp": "^0.2.3", + "ts-loader": "^9.5.1", + "tslib": "^2.8.1", + "typescript": "^5.6.3", + "webpack": "^5.96.1", + "webpack-bundle-analyzer": "^4.10.2" }, "bin": { "scrypted-changelog": "bin/scrypted-changelog.js", @@ -64,11 +71,9 @@ "scrypted-webpack": "bin/scrypted-webpack.js" }, "devDependencies": { - "@types/node": "^18.11.18", - "@types/stringify-object": "^4.0.0", - "stringify-object": "^3.3.0", - "ts-node": "^10.4.0", - "typedoc": "^0.23.21" + "@types/node": "^22.10.1", + "ts-node": "^10.9.2", + "typedoc": "^0.26.11" } }, "../common": { @@ -202,4 +207,4 @@ } } } -} \ No newline at end of file +} diff --git a/plugins/alexa/package.json b/plugins/alexa/package.json index 17dc964b00..45f301d348 100644 --- a/plugins/alexa/package.json +++ b/plugins/alexa/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/alexa", - "version": "0.3.4", + "version": "0.3.6", "scripts": { "scrypted-setup-project": "scrypted-setup-project", "prescrypted-setup-project": "scrypted-package-json", diff --git a/plugins/alexa/src/main.ts b/plugins/alexa/src/main.ts index 3ef4550202..6cb2dbf7e4 100644 --- a/plugins/alexa/src/main.ts +++ b/plugins/alexa/src/main.ts @@ -718,6 +718,9 @@ class HttpResponseLoggingImpl implements AlexaHttpResponse { sendSocket(socket: any, options: HttpResponseOptions): void { this.response.sendSocket(socket, options); } + sendStream(stream: AsyncGenerator, options?: HttpResponseOptions): void { + this.response.sendStream(stream, options); + } } export default AlexaPlugin; diff --git a/plugins/alexa/src/types/camera/capabilities.ts b/plugins/alexa/src/types/camera/capabilities.ts index f002804656..a488c4f5e0 100644 --- a/plugins/alexa/src/types/camera/capabilities.ts +++ b/plugins/alexa/src/types/camera/capabilities.ts @@ -126,68 +126,69 @@ export async function getCameraCapabilities(device: ScryptedDevice): Promise t !== 'ring' && t !== 'motion').map(type => type.toLowerCase()); - - capabilities.push( - { - "type": "AlexaInterface", - "interface": "Alexa.SmartVision.ObjectDetectionSensor", - "version": "1.0", - "properties": { - "supported": [{ - "name": "objectDetectionClasses" - }], - "proactivelyReported": true, - "retrievable": true - }, - "configuration": { - "objectDetectionConfiguration": classNames.map(type => ({ - "imageNetClass": type - })) - } - } as DiscoveryCapability - ); - - capabilities.push( - { - "type": "AlexaInterface", - "interface": "Alexa.DataController", - "instance": "Camera.SmartVisionData", - "version": "1.0", - "properties": undefined, - "configuration": { - "targetCapability": { - "name": "Alexa.SmartVision.ObjectDetectionSensor", - "version": "1.0" - }, - "dataRetrievalSchema": { - "type": "JSON", - "schema": "SmartVisionData" + const detectionTypes = await (device as any as ObjectDetector).getObjectTypes().catch(() => {}) || undefined; + const classNames = detectionTypes?.classes?.filter(t => t !== 'ring' && t !== 'motion').map(type => type.toLowerCase()).filter(c => !!c); + if (classNames?.length) { + capabilities.push( + { + "type": "AlexaInterface", + "interface": "Alexa.SmartVision.ObjectDetectionSensor", + "version": "1.0", + "properties": { + "supported": [{ + "name": "objectDetectionClasses" + }], + "proactivelyReported": true, + "retrievable": true }, - "supportedAccess": ["BY_IDENTIFIER", "BY_TIMESTAMP_RANGE"] - } - } as DiscoveryCapability - ); - } - - if (device.interfaces.includes(ScryptedInterface.MotionSensor)) { - capabilities.push( - { - "type": "AlexaInterface", - "interface": "Alexa.MotionSensor", - "version": "3", - "properties": { - "supported": [ - { - "name": "detectionState" - } - ], - "proactivelyReported": true, - "retrievable": true - } - } as DiscoveryCapability - ); + "configuration": { + "objectDetectionConfiguration": classNames.map(type => ({ + "imageNetClass": type + })) + } + } as DiscoveryCapability + ); + + capabilities.push( + { + "type": "AlexaInterface", + "interface": "Alexa.DataController", + "instance": "Camera.SmartVisionData", + "version": "1.0", + "properties": undefined, + "configuration": { + "targetCapability": { + "name": "Alexa.SmartVision.ObjectDetectionSensor", + "version": "1.0" + }, + "dataRetrievalSchema": { + "type": "JSON", + "schema": "SmartVisionData" + }, + "supportedAccess": ["BY_IDENTIFIER", "BY_TIMESTAMP_RANGE"] + } + } as DiscoveryCapability + ); + } + + if (device.interfaces.includes(ScryptedInterface.MotionSensor)) { + capabilities.push( + { + "type": "AlexaInterface", + "interface": "Alexa.MotionSensor", + "version": "3", + "properties": { + "supported": [ + { + "name": "detectionState" + } + ], + "proactivelyReported": true, + "retrievable": true + } + } as DiscoveryCapability + ); + } } return capabilities;