fix: Improve 2-way audio detection (#2293)
- For Frigate cameras, you must be running at least [integration v5.12.0](https://github.com/blakeblackshear/frigate-hass-integration/releases/tag/v5.12.0). - Closes: #2191 Includes a significant refactor of cameras, and the introduction of a `2-way-audio` capability that is dynamically fetched from `go2rtc`. One gotcha is if you previously had a substream with 2-way audio, you may need to modify ```yaml - camera_entity: camera.foo capabilities: disable_except: - substream ``` ... to ... ```yaml - camera_entity: camera.foo capabilities: disable_except: - substream - 2-way-audio ```
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { getDefaultGo2RTCEndpoint } from '../../../src/camera-manager/utils/go2rtc-endpoint.js';
|
||||
import {
|
||||
getGo2RTCMetadataEndpoint,
|
||||
getGo2RTCStreamEndpoint,
|
||||
} from '../../../src/camera-manager/utils/go2rtc/endpoint.js';
|
||||
import { createCameraConfig } from '../../test-utils.js';
|
||||
|
||||
describe('getDefaultGo2RTCEndpoint', () => {
|
||||
describe('getGo2RTCStreamEndpoint', () => {
|
||||
it('with local configuration', () => {
|
||||
expect(
|
||||
getDefaultGo2RTCEndpoint(
|
||||
getGo2RTCStreamEndpoint(
|
||||
createCameraConfig({
|
||||
go2rtc: {
|
||||
stream: 'stream',
|
||||
@@ -21,7 +24,7 @@ describe('getDefaultGo2RTCEndpoint', () => {
|
||||
|
||||
it('with remote configuration', () => {
|
||||
expect(
|
||||
getDefaultGo2RTCEndpoint(
|
||||
getGo2RTCStreamEndpoint(
|
||||
createCameraConfig({
|
||||
go2rtc: {
|
||||
stream: 'stream',
|
||||
@@ -36,6 +39,45 @@ describe('getDefaultGo2RTCEndpoint', () => {
|
||||
});
|
||||
|
||||
it('without configuration', () => {
|
||||
expect(getDefaultGo2RTCEndpoint(createCameraConfig())).toBeNull();
|
||||
expect(getGo2RTCStreamEndpoint(createCameraConfig())).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('getGo2RTCMetadataEndpoint', () => {
|
||||
it('with local configuration', () => {
|
||||
expect(
|
||||
getGo2RTCMetadataEndpoint(
|
||||
createCameraConfig({
|
||||
go2rtc: {
|
||||
stream: 'stream',
|
||||
url: '/local/path',
|
||||
},
|
||||
}),
|
||||
),
|
||||
).toEqual({
|
||||
endpoint: '/local/path/api/streams?src=stream&video=all&audio=allµphone',
|
||||
sign: true,
|
||||
});
|
||||
});
|
||||
|
||||
it('with remote configuration', () => {
|
||||
expect(
|
||||
getGo2RTCMetadataEndpoint(
|
||||
createCameraConfig({
|
||||
go2rtc: {
|
||||
stream: 'stream',
|
||||
url: 'https://my-custom-go2rtc',
|
||||
},
|
||||
}),
|
||||
),
|
||||
).toEqual({
|
||||
endpoint:
|
||||
'https://my-custom-go2rtc/api/streams?src=stream&video=all&audio=allµphone',
|
||||
sign: false,
|
||||
});
|
||||
});
|
||||
|
||||
it('without configuration', () => {
|
||||
expect(getGo2RTCMetadataEndpoint(createCameraConfig())).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user