mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Migrate weather to async (#4677)
This commit is contained in:
parent
10d1496f5a
commit
7746ecd98e
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user