mirror of
https://github.com/koush/scrypted.git
synced 2026-02-08 16:29:57 +00:00
alexa: 2 way audio
This commit is contained in:
@@ -1,27 +1,20 @@
|
||||
import sdk, { FFMpegInput, HttpResponse, MotionSensor, RTCAVSignalingSetup, RTCSignalingChannel, RTCSignalingOptions, RTCSignalingSendIceCandidate, RTCSignalingSession, ScryptedDevice, ScryptedDeviceType, ScryptedInterface, ScryptedMimeTypes, VideoCamera } from "@scrypted/sdk";
|
||||
import { HttpResponse, MotionSensor, RTCAVSignalingSetup, RTCSignalingChannel, RTCSignalingOptions, RTCSignalingSendIceCandidate, RTCSignalingSession, ScryptedDevice, ScryptedDeviceType, ScryptedInterface, VideoCamera } from "@scrypted/sdk";
|
||||
import { addSupportedType, AlexaCapabilityHandler, capabilityHandlers, EventReport } from "./common";
|
||||
import { startRTCPeerConnectionFFmpegInput } from '@scrypted/common/src/ffmpeg-to-wrtc';
|
||||
import { BrowserSignalingSession, startRTCSignalingSession } from '@scrypted/common/src/rtc-signaling';
|
||||
import crypto from 'crypto';
|
||||
import { createMessageId } from "../message";
|
||||
import { Capability } from "alexa-smarthome-ts/lib/skill/Capability";
|
||||
import { DiscoveryEndpoint } from "alexa-smarthome-ts";
|
||||
|
||||
const { mediaManager } = sdk;
|
||||
|
||||
addSupportedType(ScryptedDeviceType.Camera, {
|
||||
probe(device) {
|
||||
if (!device.interfaces.includes(ScryptedInterface.VideoCamera))
|
||||
if (!device.interfaces.includes(ScryptedInterface.RTCSignalingChannel))
|
||||
return;
|
||||
|
||||
|
||||
const capabilities: Capability<any>[] = [
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.RTCSessionController",
|
||||
"version": "3",
|
||||
"configuration": {
|
||||
"isFullDuplexAudioSupported": false,
|
||||
isFullDuplexAudioSupported: true,
|
||||
}
|
||||
} as any,
|
||||
];
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import sdk, { BinarySensor, ScryptedDevice, ScryptedDeviceType, ScryptedInterface } from "@scrypted/sdk";
|
||||
import { BinarySensor, ScryptedDevice, ScryptedDeviceType, ScryptedInterface } from "@scrypted/sdk";
|
||||
import { addSupportedType, EventReport } from "./common";
|
||||
|
||||
addSupportedType(ScryptedDeviceType.Doorbell, {
|
||||
probe(device) {
|
||||
if (!device.interfaces.includes(ScryptedInterface.VideoCamera) || !device.interfaces.includes(ScryptedInterface.BinarySensor))
|
||||
if (!device.interfaces.includes(ScryptedInterface.RTCSignalingChannel) || !device.interfaces.includes(ScryptedInterface.BinarySensor))
|
||||
return;
|
||||
|
||||
const isFullDuplexAudioSupported = device.providedInterfaces.includes(ScryptedInterface.Intercom) || device.providedInterfaces.includes(ScryptedInterface.RTCSignalingChannel);
|
||||
|
||||
return {
|
||||
displayCategories: ['CAMERA'],
|
||||
capabilities: [
|
||||
@@ -14,7 +16,7 @@ addSupportedType(ScryptedDeviceType.Doorbell, {
|
||||
"interface": "Alexa.RTCSessionController",
|
||||
"version": "3",
|
||||
"configuration": {
|
||||
"isFullDuplexAudioSupported": false,
|
||||
isFullDuplexAudioSupported: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user