Async syntax 6, sensor (#17020)

This commit is contained in:
cdce8p authored and Paulus Schoutsen committed 2018-10-01 08:55:43 +02:00
1 parent 121dba659c
commit 9e4c8f45d6
45 files changed
+195 -319

No files matched your search

+3 -6
View File
@@ -5,7 +5,6 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.otp/
"""
import time
import asyncio
import logging
import voluptuous as vol
@@ -32,9 +31,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
async def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Set up the OTP sensor."""
name = config.get(CONF_NAME)
token = config.get(CONF_TOKEN)
@@ -55,8 +53,7 @@ class TOTPSensor(Entity):
self._state = None
self._next_expiration = None
@asyncio.coroutine
def async_added_to_hass(self):
async def async_added_to_hass(self):
"""Handle when an entity is about to be added to Home Assistant."""
self._call_loop()