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

Make volume sensors update instantly by subscribing to a broadcast #4162

Conversation

marazmarci
Copy link
Contributor

@marazmarci marazmarci commented Jan 26, 2024

Summary

Audio volume sensors weren't updating instantly, so a new broadcast Intent subscription has been introduced in this PR to improve this.

How I tested these changes:
Enabled all audio-related sensors, and tried modifying the volume on the device several times, and the new values were reflected nearly instantly on the server. I did this testing for both the Android and Wear OS apps.

Screenshots

Link to pull request in Documentation repository

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

Any other notes

The broadcast is android.media.VOLUME_CHANGED_ACTION, and it is undocumented. No official Android documentation mentions it.

… sensors to the corresponding Intent action key
@dshokouhi
Copy link
Member

we should do a docs change for this PR as well to mention the sensors will update instantly in the beta. Currently we mention the volume sensors follow the normal update schedule.

https://companion.home-assistant.io/docs/core/sensors#audio-sensors

other than that functionality looks good to me :)

after this PR we should probably look at the other intents that impact more than 1 sensor and add them to the list :)

Copy link
Member

@dshokouhi dshokouhi left a comment

Choose a reason for hiding this comment

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

Looks good to me

@JBassett JBassett merged commit c185b87 into home-assistant:master Feb 2, 2024
4 checks passed
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