Skip to content

Add volume assistant sensor - #7078

Merged
TimoPtr merged 2 commits into
mainfrom
feature/assistant_volume_sensor
Jun 30, 2026
Merged

Add volume assistant sensor#7078
TimoPtr merged 2 commits into
mainfrom
feature/assistant_volume_sensor

Conversation

@TimoPtr

@TimoPtr TimoPtr commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

Add the volume assistant sensor when available (Android 17+)

Checklist

  • New or updated tests have been added to cover the changes following the testing guidelines.
  • The code follows the project's code style and best_practices.
  • The changes have been thoroughly tested, and edge cases have been considered.
  • Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.

Link to pull request in documentation repositories

User Documentation: home-assistant/companion.home-assistant#1356

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new assistant volume sensor to the Companion App’s audio sensor set, and wires it into the existing volume-change broadcast handling so the sensor can update when volume changes occur.

Changes:

  • Add a new volume_assistant BasicSensor to AudioSensorManager, including its strings and icon
  • Update SensorReceiver mappings (mobile + wear) so volume-change intents can trigger assistant volume updates
  • Extend audio mode state mapping to include MODE_ASSISTANT_CONVERSATION

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
wear/src/main/kotlin/io/homeassistant/companion/android/sensors/SensorReceiver.kt Adds volAssistant to the wear volume-change sensor mapping
common/src/main/res/values/strings.xml Adds name/description strings for the new assistant volume sensor
common/src/main/kotlin/io/homeassistant/companion/android/common/sensors/AudioSensorManager.kt Introduces volAssistant, adds availability/update gating, and extends audio mode mapping
app/src/main/kotlin/io/homeassistant/companion/android/sensors/SensorReceiver.kt Adds volAssistant to the mobile volume-change sensor mapping

@TimoPtr
TimoPtr force-pushed the feature/assistant_volume_cmd branch from b806e8b to e9873e0 Compare June 24, 2026 06:41
@TimoPtr
TimoPtr force-pushed the feature/assistant_volume_sensor branch from 52b95fc to 0c7ae12 Compare June 24, 2026 06:47
@TimoPtr
TimoPtr changed the base branch from feature/assistant_volume_cmd to feature/sensor_managers_injectable June 24, 2026 06:48
@TimoPtr
TimoPtr force-pushed the feature/sensor_managers_injectable branch from 5c5a9de to 6815184 Compare June 25, 2026 15:11
@TimoPtr
TimoPtr force-pushed the feature/assistant_volume_sensor branch from 0c7ae12 to f2f54a5 Compare June 25, 2026 15:11
@TimoPtr
TimoPtr force-pushed the feature/sensor_managers_injectable branch from 6815184 to f3dd9fd Compare June 25, 2026 15:29
@TimoPtr
TimoPtr force-pushed the feature/assistant_volume_sensor branch from f2f54a5 to bce7346 Compare June 25, 2026 15:30
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 5d05a44.

♻️ This comment has been updated with latest results.

@jpelgrom jpelgrom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One very minor suggestion and one comment on the state of icons, but the actual change is good!

"sensor",
commonR.string.sensor_name_volume_assistant,
commonR.string.sensor_description_volume_assistant,
"mdi:assistant",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is quite different from what Android uses - the correct icon appears to be Voice Chat, but MDI hasn't updated in a long time and appears to be basically dead :-/

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by MDI hasn't updated you mean a lib we use or something else?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lib we, but more importantly, core uses for icons https://pictogrammers.com/library/mdi/

Comment thread common/src/main/res/values/strings.xml Outdated
@TimoPtr
TimoPtr force-pushed the feature/sensor_managers_injectable branch from f3dd9fd to bbdf55b Compare June 29, 2026 10:35
@TimoPtr
TimoPtr force-pushed the feature/assistant_volume_sensor branch from bce7346 to 5d05a44 Compare June 29, 2026 10:35
@TimoPtr
TimoPtr force-pushed the feature/sensor_managers_injectable branch from bbdf55b to 15ba358 Compare June 29, 2026 11:42
@TimoPtr
TimoPtr force-pushed the feature/assistant_volume_sensor branch 3 times, most recently from 21ab925 to 7dccab6 Compare June 29, 2026 14:14
@TimoPtr
TimoPtr force-pushed the feature/sensor_managers_injectable branch from 7032c01 to 3088dc4 Compare June 30, 2026 07:56
@TimoPtr
TimoPtr force-pushed the feature/assistant_volume_sensor branch from a2055cf to 75ed143 Compare June 30, 2026 07:57
@TimoPtr
TimoPtr force-pushed the feature/assistant_volume_sensor branch from 75ed143 to 3437d5c Compare June 30, 2026 12:49
@TimoPtr
TimoPtr changed the base branch from feature/sensor_managers_injectable to main June 30, 2026 12:49
@TimoPtr
TimoPtr enabled auto-merge (squash) June 30, 2026 12:50
@TimoPtr TimoPtr closed this Jun 30, 2026
auto-merge was automatically disabled June 30, 2026 13:02

Pull request was closed

@TimoPtr TimoPtr reopened this Jun 30, 2026
@TimoPtr
TimoPtr enabled auto-merge (squash) June 30, 2026 13:02
@TimoPtr
TimoPtr disabled auto-merge June 30, 2026 13:31
@TimoPtr
TimoPtr merged commit 2fd1295 into main Jun 30, 2026
13 of 18 checks passed
@TimoPtr
TimoPtr deleted the feature/assistant_volume_sensor branch June 30, 2026 13:31
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.

3 participants