Skip to content

Added buienradar precipitation forecast average & total sensors#8171

Merged
balloob merged 6 commits into
home-assistant:devfrom
basschipper:weather-buienradar-forecast
Jun 24, 2017
Merged

Added buienradar precipitation forecast average & total sensors#8171
balloob merged 6 commits into
home-assistant:devfrom
basschipper:weather-buienradar-forecast

Conversation

@basschipper
Copy link
Copy Markdown
Contributor

@basschipper basschipper commented Jun 23, 2017

Description:

Added precipitation forecast average & total sensors to the buienradar components, which are available since buienradar==0.6.

Related issue (if applicable): fixes #

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

Example entry for configuration.yaml (if applicable):

sensor:
  - platform: buienradar
    monitored_conditions:
      - precipitation_forecast_total
      - precipitation_forecast_average

Checklist:

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

If the code communicates with devices, web services, or third-party tools:

  • 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.


# rounding coordinates prevents unnecessary redirects/calls
rainurl = 'http://gadgets.buienradar.nl/data/raintext/?lat={}&lon={}'.format(
round(self.coordinates[CONF_LATITUDE], 2),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

trailing whitespace

content = yield from self.get_data('http://api.buienradar.nl')

# rounding coordinates prevents unnecessary redirects/calls
rainurl = 'http://gadgets.buienradar.nl/data/raintext/?lat={}&lon={}'.format(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

line too long (85 > 79 characters)

def async_update(self, *_):
"""Update the data from buienradar."""
from buienradar.buienradar import (parse_data, CONTENT,
from buienradar.buienradar import (parse_data, CONTENT, RAINCONTENT,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'buienradar.buienradar.RAINCONTENT' imported but unused

'irradiance': ['Irradiance', 'W/m2', 'mdi:sunglasses'],
'precipitation_forecast_average': ['Precipitation forecast average',
'mm/h', 'mdi:weather-pouring'],
'precipitation_forecast_total': ['Precipitation forecast total',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

trailing whitespace

'windgust': ['Wind gust', 'm/s', 'mdi:weather-windy'],
'precipitation': ['Precipitation', 'mm/h', 'mdi:weather-pouring'],
'irradiance': ['Irradiance', 'W/m2', 'mdi:sunglasses'],
'precipitation_forecast_average': ['Precipitation forecast average',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

trailing whitespace

@balloob balloob merged commit 6234f2d into home-assistant:dev Jun 24, 2017
@balloob
Copy link
Copy Markdown
Member

balloob commented Jun 24, 2017

Great! 🐬

@balloob balloob mentioned this pull request Jul 1, 2017
dethpickle pushed a commit to dethpickle/home-assistant that referenced this pull request Aug 18, 2017
…-assistant#8171)

* Added precipitation forecast average & total sensors

* Fixed some code style issues

* Fixed some code style issues

* Minor fix default timeframe

* Update buienradar.py

* Update buienradar.py
@home-assistant home-assistant locked and limited conversation to collaborators Oct 20, 2017
@basschipper basschipper deleted the weather-buienradar-forecast branch February 28, 2018 20:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants