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

Add support for wind, battery, radio signals for Netatmo sensor #2351

Merged
merged 5 commits into from
Jun 22, 2016
Merged

Conversation

Jypy
Copy link
Contributor

@Jypy Jypy commented Jun 22, 2016

Description:

Related issue (if applicable): fixes #

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#

Example entry for configuration.yaml (if applicable):

Checklist:

If user exposed functionality or configuration variables are added/changed:

If code communicates with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@@ -24,6 +24,15 @@
'rain': ['Rain', 'mm', 'mdi:weather-rainy'],
'sum_rain_1': ['sum_rain_1', 'mm', 'mdi:weather-rainy'],
'sum_rain_24': ['sum_rain_24', 'mm', 'mdi:weather-rainy'],
'battery_vp': ['Battery','','mdi:battery'],

Choose a reason for hiding this comment

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

farcy v1.1

  • 30: E231 missing whitespace after ','
  • 33: E231 missing whitespace after ','

@fabaff
Copy link
Member

fabaff commented Jun 22, 2016

Add # pylint: disable=too-many-statements. Easier than re-factoring the part in question.

@Danielhiversen Danielhiversen changed the title Add support for wind, battery, radio signals Add support for wind, battery, radio signals for Netatmo sensor Jun 22, 2016
@Jypy
Copy link
Contributor Author

Jypy commented Jun 22, 2016

Thanks @fabaff!

@@ -11,19 +11,31 @@
from homeassistant.util import Throttle
from homeassistant.loader import get_component

# Fix for pylint too many statements error
# pylint: disable=too-many-statements
Copy link
Member

Choose a reason for hiding this comment

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

You shouldn't add this here at the top of the module, but local where the problem is. Put it on the next row directly after the docstring in the update method, near row 109. The disable statement has scope, so it's best to disable as little as possible, and it also makes it easier to see why it was needed.

The update method could be refactored to avoid the disable. It might be out of scope for this PR, but I would do a nested dict lookup and have a function that checks if data value is above inner dict value.

@balloob
Copy link
Member

balloob commented Jun 22, 2016

Looks good 🐬 💨

@balloob balloob merged commit 9ce9b8d into home-assistant:dev Jun 22, 2016
@Jypy
Copy link
Contributor Author

Jypy commented Jun 22, 2016

Perfect!
Thanks

@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants