fix: Use auto_unmute as input to stream selection for HA (#2562)

- Closes #2479
This commit is contained in:
Dermot Duffy
2026-07-03 08:19:11 -07:00
committed by GitHub
parent 6a6d65d5c5
commit 3494706225
7 changed files with 428 additions and 61 deletions
@@ -0,0 +1,25 @@
import { describe, expect, it } from 'vitest';
import { isAudioIntendedOnLoad } from '../../../src/components-lib/live/audio-intent';
describe('isAudioIntendedOnLoad', () => {
it('should return false when no conditions are set', () => {
expect(isAudioIntendedOnLoad([])).toBe(false);
});
it('should return false for the default microphone and call conditions', () => {
expect(isAudioIntendedOnLoad(['microphone', 'call'])).toBe(false);
});
it('should return true when selected is a condition', () => {
expect(isAudioIntendedOnLoad(['selected'])).toBe(true);
});
it('should return true when visible is a condition', () => {
expect(isAudioIntendedOnLoad(['visible'])).toBe(true);
});
it('should return true when a positive condition is combined with others', () => {
expect(isAudioIntendedOnLoad(['call', 'visible'])).toBe(true);
});
});