feat: Allow 2-way audio detection to be skipped and timed (#2355)

- For #2313
This commit is contained in:
Dermot Duffy
2026-02-16 19:47:56 -08:00
committed by GitHub
parent f34c7e8ee1
commit a15376602f
14 changed files with 337 additions and 34 deletions
+28 -2
View File
@@ -71,7 +71,11 @@ describe('live-provider utils', () => {
live_provider: 'ha',
});
const hass = createHASS();
const result = await liveProviderSupports2WayAudio(hass, config);
const result = await liveProviderSupports2WayAudio(
hass,
config,
config.go2rtc.metadata_fetch_timeout_seconds,
);
expect(result).toBe(false);
});
@@ -82,10 +86,32 @@ describe('live-provider utils', () => {
const hass = createHASS();
vi.mocked(go2rtcAudio.supports2WayAudio).mockResolvedValue(true);
const result = await liveProviderSupports2WayAudio(hass, config);
const result = await liveProviderSupports2WayAudio(
hass,
config,
config.go2rtc.metadata_fetch_timeout_seconds,
);
expect(result).toBe(true);
expect(go2rtcAudio.supports2WayAudio).toHaveBeenCalledWith(
hass,
2,
undefined,
undefined,
);
});
it('should pass metadata fetch timeout through to go2rtc detection', async () => {
const config = createCameraConfig({
live_provider: 'go2rtc',
});
const hass = createHASS();
vi.mocked(go2rtcAudio.supports2WayAudio).mockResolvedValue(true);
await liveProviderSupports2WayAudio(hass, config, 30);
expect(go2rtcAudio.supports2WayAudio).toHaveBeenCalledWith(
hass,
30,
undefined,
undefined,
);