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
@@ -4,7 +4,6 @@ Show the amount of records in a user's Discogs collection.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.discogs/
"""
import asyncio
from datetime import timedelta
import logging
@@ -36,9 +35,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 Discogs sensor."""
import discogs_client
@@ -92,7 +90,6 @@ class DiscogsSensor(Entity):
ATTR_IDENTITY: self._identity.name,
}
@asyncio.coroutine
def async_update(self):
async def async_update(self):
"""Set state to the amount of records in user's collection."""
self._state = self._identity.num_collection