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:
@@ -83,8 +83,9 @@ export class MenuButtonController {
|
||||
this._getCameraUIButton(config, options?.showCameraUIButton),
|
||||
this._getMicrophoneButton(
|
||||
config,
|
||||
cameraManager,
|
||||
options?.view,
|
||||
options?.microphoneManager,
|
||||
options?.currentMediaLoadedInfo,
|
||||
),
|
||||
this._getExpandButton(config, options?.inExpandedMode),
|
||||
this._getFullscreenButton(config, options?.fullscreenManager),
|
||||
@@ -381,10 +382,17 @@ export class MenuButtonController {
|
||||
|
||||
protected _getMicrophoneButton(
|
||||
config: AdvancedCameraCardConfig,
|
||||
cameraManager: CameraManager,
|
||||
view?: View | null,
|
||||
microphoneManager?: MicrophoneManager | null,
|
||||
currentMediaLoadedInfo?: MediaLoadedInfo | null,
|
||||
): MenuItem | null {
|
||||
if (microphoneManager && currentMediaLoadedInfo?.capabilities?.supports2WayAudio) {
|
||||
if (!view) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const capabilities = cameraManager.getCameraCapabilities(getStreamCameraID(view));
|
||||
|
||||
if (microphoneManager && capabilities?.has('2-way-audio')) {
|
||||
const unavailable =
|
||||
microphoneManager.isForbidden() || !microphoneManager.isSupported();
|
||||
const muted = microphoneManager.isMuted();
|
||||
|
||||
Reference in New Issue
Block a user