mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 14:45:09 +02:00
add-template: remove unused import
This commit is contained in:
@@ -26,7 +26,6 @@ from homeassistant.components.fan import (SPEED_LOW, SPEED_MEDIUM,
|
||||
ENTITY_ID_FORMAT)
|
||||
|
||||
from homeassistant.helpers.entity import async_generate_entity_id
|
||||
from homeassistant.helpers.event import async_track_state_change
|
||||
from homeassistant.helpers.script import Script
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@@ -234,7 +233,7 @@ class TemplateFan(FanEntity):
|
||||
|
||||
if speed in self._speed_list:
|
||||
self._speed = speed
|
||||
self.hass.async_add_job(
|
||||
yield from self.hass.async_add_job(
|
||||
self._set_speed_script.async_run({ATTR_SPEED: speed}))
|
||||
else:
|
||||
_LOGGER.error(
|
||||
@@ -253,7 +252,8 @@ class TemplateFan(FanEntity):
|
||||
|
||||
if oscillating is True or oscillating is False:
|
||||
self._oscillating = oscillating
|
||||
self.hass.async_add_job(self._set_oscillating_script.async_run(
|
||||
yield from self.hass.async_add_job(
|
||||
self._set_oscillating_script.async_run(
|
||||
{ATTR_OSCILLATING: oscillating}))
|
||||
else:
|
||||
_LOGGER.error(
|
||||
@@ -271,7 +271,7 @@ class TemplateFan(FanEntity):
|
||||
@callback
|
||||
def template_fan_startup(event):
|
||||
"""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.async_schedule_update_ha_state(True)
|
||||
|
Reference in New Issue
Block a user