Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Audio Output sensors, rename Microphone to Audio Input #1978

Merged
merged 4 commits into from
Dec 7, 2021

Conversation

zacwest
Copy link
Member

@zacwest zacwest commented Dec 7, 2021

Fixes #1958.

Summary

Existing Core Audio stuff already exposes the output devices pretty easily, so creating sensors from 'em is pretty easy.

Sensor Values

Roughly identical to microphones:

Sensor Attributes Description
sensor.active_audio_input All, Active The name of the active audio input (microphone), or Inactive if not in use.
sensor.active_audio_output All, Active The name of the active audio output (speaker), or Inactive if not in use.
binary_sensor.audio_input_in_use None Whether an audio output (microphone) on the system is currently in use.
binary_sensor.audio_output_in_use None Whether an audio output (speaker) on the system is currently in use.

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#627

Any other notes

This updates relatively instantly for when output starts, but takes a few seconds before it updates once output pauses.

Existing microphone sensors won't have their unique IDs changed, but their display name will change. New installs will get the new unique ID.

@codecov
Copy link

codecov bot commented Dec 7, 2021

Codecov Report

Merging #1978 (888d626) into master (e788cfe) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1978   +/-   ##
=======================================
  Coverage   29.01%   29.01%           
=======================================
  Files         268      268           
  Lines       20956    20957    +1     
=======================================
+ Hits         6080     6081    +1     
  Misses      14876    14876           
Impacted Files Coverage Δ
.../API/Webhook/Sensors/InputOutputDeviceSensor.swift 69.23% <100.00%> (ø)
Sources/Shared/Environment/Environment.swift 66.97% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e788cfe...888d626. Read the comment docs.

@zacwest zacwest changed the title Add Speaker sensors Add Audio Output sensors, rename Microphone to Audio Input Dec 7, 2021
@zacwest zacwest merged commit 546125d into master Dec 7, 2021
@zacwest zacwest deleted the speaker-sensor branch December 7, 2021 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants