Async syntax 6, sensor (#17020)

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

View file

@ -4,7 +4,6 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.mychevy/
"""
import asyncio
import logging
from homeassistant.components.mychevy import (
@ -55,8 +54,7 @@ class MyChevyStatus(Entity):
"""Initialize sensor with car connection."""
self._state = None
@asyncio.coroutine
def async_added_to_hass(self):
async def async_added_to_hass(self):
"""Register callbacks."""
self.hass.helpers.dispatcher.async_dispatcher_connect(
UPDATE_TOPIC, self.success)
@ -129,8 +127,7 @@ class EVSensor(Entity):
slugify(self._car.name),
slugify(self._name)))
@asyncio.coroutine
def async_added_to_hass(self):
async def async_added_to_hass(self):
"""Register callbacks."""
self.hass.helpers.dispatcher.async_dispatcher_connect(
UPDATE_TOPIC, self.async_update_callback)