Update syntax (#14812)

This commit is contained in:
Fabian Affolter 2018-06-04 14:44:55 +02:00 committed by Martin Hjelmare
parent 1d23f7f900
commit bd1b1a9ff9

View File

@ -4,7 +4,6 @@ Support for tracking the moon phases.
For more details about this platform, please refer to the documentation at For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.moon/ https://home-assistant.io/components/sensor.moon/
""" """
import asyncio
import logging import logging
import voluptuous as vol import voluptuous as vol
@ -26,8 +25,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
}) })
@asyncio.coroutine async def async_setup_platform(
def async_setup_platform(hass, config, async_add_devices, discovery_info=None): hass, config, async_add_devices, discovery_info=None):
"""Set up the Moon sensor.""" """Set up the Moon sensor."""
name = config.get(CONF_NAME) name = config.get(CONF_NAME)
@ -71,8 +70,7 @@ class MoonSensor(Entity):
"""Icon to use in the frontend, if any.""" """Icon to use in the frontend, if any."""
return ICON return ICON
@asyncio.coroutine async def async_update(self):
def async_update(self):
"""Get the time and updates the states.""" """Get the time and updates the states."""
from astral import Astral from astral import Astral