Update the Russound RNET component to use enhanced Russound.py #9739
Conversation
| self._source = None | ||
|
|
||
| _LOGGER.error("Could not update status for zone %s", self._zone_id) | ||
|
|
| #index = self._russ.get_source('1', self._zone_id) | ||
| index = ret[1] | ||
| # Possibility exists that user has defined list of all sources. | ||
| # If a source is set externally that is beyond the defined list then |
| #self._volume = self._russ.get_volume('1', self._zone_id) / 100.0 | ||
|
|
||
| # Returns 0 based index for source. | ||
| #index = self._russ.get_source('1', self._zone_id) |
There was a problem hiding this comment.
block comment should start with '# '
| self._state = STATE_ON | ||
|
|
||
| self._volume = ret[2] * 2 / 100.0 | ||
| #self._volume = self._russ.get_volume('1', self._zone_id) / 100.0 |
There was a problem hiding this comment.
block comment should start with '# '
| _LOGGER.debug("ret= %s", ret) | ||
| if ret is not None: | ||
| _LOGGER.debug("Updating status for zone %s", self._zone_id) | ||
| #if self._russ.get_power('1', self._zone_id) == 0: |
There was a problem hiding this comment.
block comment should start with '# '
altersis
left a comment
There was a problem hiding this comment.
I have changed the code to satisfy Houndbot style observations
|
Ping -> Fix travis please |
|
Can I please ask for your help? I'm not familiar with Travis, and for that reason I do not understand what needs to be fixed... I'll do it gladly, just need to understand what's the problem... thanks! |
|
Hi Pascal, thanks again for your reminder about the pending PR on Hass! I tried contacting you at pvizeli@syshack.ch<mailto:pvizeli@syshack.ch>, but it seems you did not get my email.
I’m a bit stuck on this, and was hoping that someone from the community will contact me. Thanks again for that. Could you please help me understand what the problem is? I read and read the error message, but I simply cannot figure out what the issue is. I can see that there are five jobs on the travis check, and one of them failed, the one related to Python 3.4.2. I read somewhere that Hass will be dropping support for Python 3.4 on release 55, which is out now. Do I still need to worry about a Python 3.4.2 issue? If the we have to, no problem, will do it.
From the log, I get that the error is here:
GLOB sdist-make: /home/travis/build/home-assistant/home-assistant/setup.py
requirements create: /home/travis/build/home-assistant/home-assistant/.tox/requirements
requirements inst: /home/travis/build/home-assistant/home-assistant/.tox/dist/homeassistant-0.55.0.zip
requirements installed: aiohttp==2.2.5,astral==1.4,async-timeout==1.4.0,chardet==3.0.4,homeassistant==0.55.0,Jinja2==2.9.6,MarkupSafe==1.0,multidict==3.2.0,pytz==2017.2,PyYAML==3.12,requests==2.14.2,typing==3.6.2,voluptuous==0.10.5,yarl==0.13.0
requirements runtests: PYTHONHASHSEED='1077194535'
requirements runtests: commands[0] | python script/gen_requirements_all.py validate
******* ERROR
requirements_all.txt is not up to date
Please run script/gen_requirements_all.py
ERROR: InvocationError: '/home/travis/build/home-assistant/home-assistant/.tox/requirements/bin/python script/gen_requirements_all.py validate'
And what I understand is that a file called requirements_all.txt needs to be updated… is there a document that you can point me to do this? I found a brief reference to it on the developer documentation, but I really don’t understand what I have to do.
Thanks in advance!
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
From: Pascal Vizeli<mailto:notifications@github.com>
Sent: Friday, October 13, 2017 4:56 AM
To: home-assistant/home-assistant<mailto:home-assistant@noreply.github.com>
Cc: Gerardo Castillo<mailto:altersis@hotmail.com>; Mention<mailto:mention@noreply.github.com>
Subject: Re: [home-assistant/home-assistant] Update the Russound RNET component to use enhanced Russound.py (#9739)
Ping -> Fix travis please
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#9739 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AeprTcl6bjnZzCE6QoZyBKNy1f1QsDUlks5sryWtgaJpZM4PxhXl>.
|
|
with the help of @armills, I finally got to understand what was missing here. Thanks! what comes next? |
emlove
left a comment
There was a problem hiding this comment.
LGTM, but added one small note on code style.
| # amount of traffic and speeding up the update process. | ||
| ret = self._russ.get_zone_info('1', self._zone_id, 4) | ||
| _LOGGER.debug("ret= %s", ret) | ||
| if ret is not None: |
There was a problem hiding this comment.
Preference:
Our preferred style is the pattern shown below. This saves us from having to indent the rest of the function. This will also line up the indentation of the comments below with the code.
if ret is None:
_LOGGER.error("Could not update status for zone %s", self._zone_id)
return
_LOGGER.debug("Updating status for zone %s", self._zone_id)
…There was a problem hiding this comment.
Hi @armills , thank you for your feedback. Could it be possible to do the merge like this just for this moment, so that I can concentrate on additional enhancements to the Russound RNET component? Right now this component cannot reconnect if there is a communications error (forcing you to a full Hass restart), and would like to make fixing this my first priority. I will have the update ready in a week from now (including this style change). Do you agree?
There was a problem hiding this comment.
Yep, that's no problem. Not a blocker to merge. Thanks for the contribution! 🎉
|
@armills , @andrey-git as an FYI - I have tested this code on my Russound and it works well. @altersis has walked me through the improvements and from my side I am happy. |
|
Thanks @altersis, @armills and @acambitsis for this. I've been running this code from the PR for a few days so glad it's now merged in :) |
Description:
Related issue (if applicable): fixes #9604
Related to issue #6 in the russound rnet component.
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>
No documentation change is necessary
Example entry for
configuration.yaml(if applicable): No configuration.yaml changes are necessaryChecklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
toxrun successfully. Your PR cannot be merged unless tests passREQUIREMENTSvariable (example).requirements_all.txtby runningscript/gen_requirements_all.py. No new dependencies added..coveragerc. No new files added.If the code does not interact with devices: N/A
toxrun successfully. Your PR cannot be merged unless tests pass