-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
New media_player platform for Russound devices using the RIO protocol #8448
Conversation
Auto discovers zones and sources Handles media metadata from sources that support it asyncio implementation Push updates for any zone or source changes so no polling required.
@wickerwaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @fabaff and @robbiet480 to be potential reviewers. |
Hello @wickerwaka, When attempting to inspect the commits of your pull request for CLA signature status among all authors we encountered commit(s) which were not linked to a GitHub account, thus not allowing us to determine their status(es). The commits that are missing a linked GitHub account are the following:
Unfortunately, we are unable to accept this pull request until this situation is corrected. Here are your options:
We apologize for this inconvenience, especially since it usually bites new contributors to Home Assistant. We hope you understand the need for us to protect ourselves and the great community we all have built legally. The best thing to come out of this is that you only need to fix this once and it benefits the entire Home Assistant and GitHub community. Thanks, I look forward to checking this PR again soon! ❤️ |
Hello @wickerwaka, When attempting to inspect the commits of your pull request for CLA signature status among all authors we encountered commit(s) which were not linked to a GitHub account, thus not allowing us to determine their status(es). The commits that are missing a linked GitHub account are the following:
Unfortunately, we are unable to accept this pull request until this situation is corrected. Here are your options:
We apologize for this inconvenience, especially since it usually bites new contributors to Home Assistant. We hope you understand the need for us to protect ourselves and the great community we all have built legally. The best thing to come out of this is that you only need to fix this once and it benefits the entire Home Assistant and GitHub community. Thanks, I look forward to checking this PR again soon! ❤️ |
Documentation at home-assistant/home-assistant.io#2969 |
I resolved the CLA issue with this PR, but it doesn't look like the bot removed the label. |
Oh, this is good news. Can't wait to try this out! |
Each zone is added as a separate media player device. If the source that the | ||
zone is assigned to is capable of sending metadata such as artist/album name | ||
then this data will be reported back via the media_* properties. | ||
""" |
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.
Please look to other component/platform how that comments need to be.
if host is None or port is None: | ||
_LOGGER.error("Invalid config. Expected %s and %s", | ||
CONF_HOST, CONF_PORT) | ||
return False |
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.
Remove this, we do that on PLATFORM_SCHEMA
except CommandException: | ||
break | ||
if name != '': | ||
sources.append((source_id, 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.
Move that into try block. Better would be if you API can get a list of exists source instead to trow 16 exceptions for that.
else: | ||
return None | ||
|
||
def __init__(self, russ, zone_id, name, sources): |
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.
please move init function on top of class
self._zone_id = zone_id | ||
self._sources = sources | ||
self._russ.add_zone_callback(self._zone_callback_handler) | ||
self._russ.add_source_callback(self._source_callback_handler) |
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.
Move callback handling into async_added_to_hass
Interface function
@asyncio.coroutine | ||
def async_turn_off(self): | ||
"""Turn off the zone.""" | ||
yield from self._russ.send_zone_event(self._zone_id, |
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.
remove the @asyncio.coroutine
and return a coroutine
@asyncio.coroutine | ||
def async_turn_on(self): | ||
"""Turn on the zone.""" | ||
yield from self._russ.send_zone_event(self._zone_id, |
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.
remove the @asyncio.coroutine
and return a coroutine
def async_set_volume_level(self, volume): | ||
"""Set the volume level.""" | ||
rvol = int(volume * 50.0) | ||
yield from self._russ.send_zone_event(self._zone_id, |
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.
remove the @asyncio.coroutine
and return a coroutine
for source_id, name in self._sources: | ||
if name.lower() != source.lower(): | ||
continue | ||
yield from self._russ.send_zone_event( |
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.
remove the @asyncio.coroutine
and return a coroutine
return None | ||
return value | ||
else: | ||
return None |
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.
make that cleaner with if xy in (None, "", "---"):
Updated russound_rio dependency to 0.1.3 Use enumerate_zones and enumerate_sources methods instead of doing it in the platform. Register callbacks in async_added_to_hass coroutine Corrected behavior of async methods
…home-assistant#8448) * New media_player platform for Russound devices using the RIO protocol Auto discovers zones and sources Handles media metadata from sources that support it asyncio implementation Push updates for any zone or source changes so no polling required. * Fixed up linting issues * Addressing PR feedback Updated russound_rio dependency to 0.1.3 Use enumerate_zones and enumerate_sources methods instead of doing it in the platform. Register callbacks in async_added_to_hass coroutine Corrected behavior of async methods
media_player platform for Russound devices using the RIO protocol
Auto discovers zones and sources
Handles media metadata from sources that support it
asyncio implementation
Push updates for any zone or source changes so no polling required.
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable ([example][ex-requir]).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.