Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
OttoWinter committed Dec 17, 2018
1 parent 6eac612 commit 691900d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
5 changes: 4 additions & 1 deletion homeassistant/components/esphome/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
DISPATCHER_ON_DEVICE_UPDATE = 'esphome_{entry_id}_on_device_update'
DISPATCHER_ON_STATE = 'esphome_{entry_id}_on_state'
# The HA component types this integration supports
HA_COMPONENTS = ['sensor']
HA_COMPONENTS = [
'sensor',
'fan',
]

_LOGGER = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Support for esphomelib fans."""
"""Support for ESPHome fans."""
import logging
from typing import List, Optional, TYPE_CHECKING

from homeassistant.components.esphomelib import EsphomelibEntity, \
from homeassistant.components.esphome import EsphomeEntity, \
platform_async_setup_entry
from homeassistant.components.fan import FanEntity, SPEED_HIGH, SPEED_LOW, \
SPEED_MEDIUM, SUPPORT_OSCILLATE, SUPPORT_SET_SPEED, SPEED_OFF
Expand All @@ -11,22 +11,22 @@

if TYPE_CHECKING:
# pylint: disable=unused-import
from aioesphomeapi.client import FanInfo, FanState
from aioesphomeapi import FanInfo, FanState

DEPENDENCIES = ['esphomelib']
DEPENDENCIES = ['esphome']
_LOGGER = logging.getLogger(__name__)


async def async_setup_entry(hass: HomeAssistantType,
entry: ConfigEntry, async_add_entities) -> None:
"""Set up esphomelib fans based on a config entry."""
"""Set up ESPHome fans based on a config entry."""
# pylint: disable=redefined-outer-name
from aioesphomeapi.client import FanInfo, FanState
from aioesphomeapi import FanInfo, FanState

await platform_async_setup_entry(
hass, entry, async_add_entities,
component_key='fan',
info_type=FanInfo, entity_type=EsphomelibFan,
info_type=FanInfo, entity_type=EsphomeFan,
state_type=FanState
)

Expand All @@ -39,8 +39,8 @@ async def async_setup_entry(hass: HomeAssistantType,
FAN_SPEED_INT_TO_STR = {v: k for k, v in FAN_SPEED_STR_TO_INT.items()}


class EsphomelibFan(EsphomelibEntity, FanEntity):
"""A fan implementation for esphomelib."""
class EsphomeFan(EsphomeEntity, FanEntity):
"""A fan implementation for ESPHome."""

@property
def _static_info(self) -> 'FanInfo':
Expand Down

0 comments on commit 691900d

Please sign in to comment.