add-template: remove unused import

This commit is contained in:
Giang Vo
2017-11-02 08:12:14 +11:00
parent 42944b2dd9
commit 514aaf618f

View File

@@ -26,7 +26,6 @@ from homeassistant.components.fan import (SPEED_LOW, SPEED_MEDIUM,
ENTITY_ID_FORMAT) ENTITY_ID_FORMAT)
from homeassistant.helpers.entity import async_generate_entity_id from homeassistant.helpers.entity import async_generate_entity_id
from homeassistant.helpers.event import async_track_state_change
from homeassistant.helpers.script import Script from homeassistant.helpers.script import Script
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@@ -234,7 +233,7 @@ class TemplateFan(FanEntity):
if speed in self._speed_list: if speed in self._speed_list:
self._speed = speed self._speed = speed
self.hass.async_add_job( yield from self.hass.async_add_job(
self._set_speed_script.async_run({ATTR_SPEED: speed})) self._set_speed_script.async_run({ATTR_SPEED: speed}))
else: else:
_LOGGER.error( _LOGGER.error(
@@ -253,8 +252,9 @@ class TemplateFan(FanEntity):
if oscillating is True or oscillating is False: if oscillating is True or oscillating is False:
self._oscillating = oscillating self._oscillating = oscillating
self.hass.async_add_job(self._set_oscillating_script.async_run( yield from self.hass.async_add_job(
{ATTR_OSCILLATING: oscillating})) self._set_oscillating_script.async_run(
{ATTR_OSCILLATING: oscillating}))
else: else:
_LOGGER.error( _LOGGER.error(
'Received invalid oscillating: %s. ' + 'Received invalid oscillating: %s. ' +
@@ -271,7 +271,7 @@ class TemplateFan(FanEntity):
@callback @callback
def template_fan_startup(event): def template_fan_startup(event):
"""Update template on startup.""" """Update template on startup."""
async_track_state_change( self.hass.hepers.event.async_track_state_change(
self.hass, self._entities, template_fan_state_listener) self.hass, self._entities, template_fan_state_listener)
self.async_schedule_update_ha_state(True) self.async_schedule_update_ha_state(True)