-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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 Roon volume hooks #102470
Add Roon volume hooks #102470
Conversation
@MartinHjelmare Thanks for your feedback - have refactored using event entities. I think it's a decent improment - both from a development and user experience perspective. |
@MartinHjelmare I tried removing the "OPTIONS_SCHEMA" in |
I meant that we shouldn't have an option at all. Just always create the event entity. |
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Sorry to ask for help @MartinHjelmare My WIP refactor is in the repo - I've really just reproduced the media entity creation logic - but I'm getting a strange error when I try to add the event entities.
As far as I can see this method is related to the locking of access to entities, although I imaging this is provided by a base class. Any suggestion on where to look. Google seems not to be my friend in this case. |
@property | ||
def name(self) -> str: | ||
"""Return name for the entity.""" | ||
return self._name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow up PR should preferably take care of this comment:
# Instead of setting the device name to the entity name, roon |
https://developers.home-assistant.io/docs/core/entity#entity-naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, will take a look…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thanks for all your help @MartinHjelmare, this is a far better PR for your suggestions and support. |
Proposed change
Replacement for #99684 using Entity events rather than device triggers.
Roon via their API provide a means of hooking the volume control in their app suite and providing your own implementation of the volume control.
This can be useful in a situation where Home Assistant has control over the volume of a media player - but Roon natively does not.
Roon media players are often streamers connected to other devices.
An example would be an amplifier or similar device connected to a Roon streamer - where the amplifier has its own HA integration with control over the volume, or can respond to HA via an IR blaster.
This PR allows you to set up a volume control in the Roon apps. When this is changed - a event entity created in HA - allowing you to control the volume using HA's facilities.
Type of change
Additional information
This screenshot shows how the volume controls are exposed in the roon app:
And this shows the volume control buttons in the roon app:
And this is an example automation:
This PR requires verion 0.1.5 of the pyroon library - which contains adds the ability to de-register volume hooks.
The library diff is here:
pavoni/pyroon@0.1.4...0.1.5
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: