Async syntax 3/8 (#17017)

* Async syntax 3, device_tracker & fan & hassio & image_processing & input

* Pylint fixes
This commit is contained in:
cdce8p 2018-10-01 08:59:45 +02:00 committed by Paulus Schoutsen
parent 134eeecd65
commit b24f9f5dfa
23 changed files with 194 additions and 286 deletions

View file

@ -4,7 +4,6 @@ Support for tracking MQTT enabled devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.mqtt/
"""
import asyncio
import logging
import voluptuous as vol
@ -25,8 +24,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(mqtt.SCHEMA_BASE).extend({
})
@asyncio.coroutine
def async_setup_scanner(hass, config, async_see, discovery_info=None):
async def async_setup_scanner(hass, config, async_see, discovery_info=None):
"""Set up the MQTT tracker."""
devices = config[CONF_DEVICES]
qos = config[CONF_QOS]
@ -38,7 +36,7 @@ def async_setup_scanner(hass, config, async_see, discovery_info=None):
hass.async_add_job(
async_see(dev_id=dev_id, location_name=payload))
yield from mqtt.async_subscribe(
await mqtt.async_subscribe(
hass, topic, async_message_received, qos)
return True