Migrate weather to async (#4677)

This commit is contained in:
Pascal Vizeli 2016-12-04 02:58:44 +01:00 committed by Paulus Schoutsen
parent 10d1496f5a
commit 7746ecd98e

View File

@ -4,6 +4,7 @@ Weather component that handles meteorological data for your location.
For more details about this component, please refer to the documentation at For more details about this component, please refer to the documentation at
https://home-assistant.io/components/weather/ https://home-assistant.io/components/weather/
""" """
import asyncio
import logging import logging
from numbers import Number from numbers import Number
@ -30,11 +31,12 @@ ATTR_WEATHER_WIND_BEARING = 'wind_bearing'
ATTR_WEATHER_WIND_SPEED = 'wind_speed' ATTR_WEATHER_WIND_SPEED = 'wind_speed'
def setup(hass, config): @asyncio.coroutine
def async_setup(hass, config):
"""Setup the weather component.""" """Setup the weather component."""
component = EntityComponent(_LOGGER, DOMAIN, hass) component = EntityComponent(_LOGGER, DOMAIN, hass)
component.setup(config)
yield from component.async_setup(config)
return True return True