Migrate calendar setup to async. (#6305)

pull/6265/head
Pascal Vizeli 2017-02-28 10:49:06 +01:00 committed by GitHub
parent faf8bbcf13
commit aa1f64bed6
1 changed files with 4 additions and 4 deletions

View File

@ -3,8 +3,8 @@ Support for Google Calendar event device sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/calendar/
"""
import asyncio
import logging
from datetime import timedelta
@ -27,13 +27,13 @@ DOMAIN = 'calendar'
ENTITY_ID_FORMAT = DOMAIN + '.{}'
def setup(hass, config):
@asyncio.coroutine
def async_setup(hass, config):
"""Track states and offer events for calendars."""
component = EntityComponent(
logging.getLogger(__name__), DOMAIN, hass, SCAN_INTERVAL, DOMAIN)
component.setup(config)
yield from component.async_setup(config)
return True