diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index e7951afe31a..16020f1ecb1 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -52,7 +52,7 @@ import logging import os import csv -from homeassistant.helpers.device_component import DeviceComponent +from homeassistant.helpers.entity_component import EntityComponent import homeassistant.util as util from homeassistant.const import ( @@ -140,7 +140,7 @@ def turn_off(hass, entity_id=None, transition=None): def setup(hass, config): """ Exposes light control via statemachine and services. """ - component = DeviceComponent( + component = EntityComponent( _LOGGER, DOMAIN, hass, SCAN_INTERVAL, DISCOVERY_PLATFORMS, GROUP_NAME_ALL_LIGHTS) component.setup(config) diff --git a/homeassistant/components/media_player/__init__.py b/homeassistant/components/media_player/__init__.py index 4623c538e62..00fee802397 100644 --- a/homeassistant/components/media_player/__init__.py +++ b/homeassistant/components/media_player/__init__.py @@ -8,7 +8,7 @@ import logging from homeassistant.components import discovery from homeassistant.helpers.entity import Entity -from homeassistant.helpers.device_component import DeviceComponent +from homeassistant.helpers.entity_component import EntityComponent from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_VOLUME_UP, SERVICE_VOLUME_DOWN, SERVICE_MEDIA_PLAY_PAUSE, SERVICE_MEDIA_PLAY, @@ -126,7 +126,7 @@ SERVICE_TO_METHOD = { def setup(hass, config): """ Track states and offer events for media_players. """ - component = DeviceComponent( + component = EntityComponent( logging.getLogger(__name__), DOMAIN, hass, SCAN_INTERVAL, DISCOVERY_PLATFORMS) diff --git a/homeassistant/components/scene.py b/homeassistant/components/scene.py index df7d26e8b3f..979b3281300 100644 --- a/homeassistant/components/scene.py +++ b/homeassistant/components/scene.py @@ -20,7 +20,7 @@ from collections import namedtuple from homeassistant import State from homeassistant.helpers.entity import ToggleEntity -from homeassistant.helpers.device_component import DeviceComponent +from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.state import reproduce_state from homeassistant.const import ( ATTR_ENTITY_ID, STATE_OFF, STATE_ON, SERVICE_TURN_ON, SERVICE_TURN_OFF) @@ -46,7 +46,7 @@ def setup(hass, config): logger.error('Scene config should be a list of scenes') return False - component = DeviceComponent(logger, DOMAIN, hass) + component = EntityComponent(logger, DOMAIN, hass) component.add_entities(Scene(hass, _process_config(scene_config)) for scene_config in scene_configs) diff --git a/homeassistant/components/sensor/__init__.py b/homeassistant/components/sensor/__init__.py index 1aebf7f59ad..8248651710a 100644 --- a/homeassistant/components/sensor/__init__.py +++ b/homeassistant/components/sensor/__init__.py @@ -5,7 +5,7 @@ Component to interface with various sensors that can be monitored. """ import logging -from homeassistant.helpers.device_component import DeviceComponent +from homeassistant.helpers.entity_component import EntityComponent from homeassistant.components import wink, zwave DOMAIN = 'sensor' @@ -23,7 +23,7 @@ DISCOVERY_PLATFORMS = { def setup(hass, config): """ Track states and offer events for sensors. """ - component = DeviceComponent( + component = EntityComponent( logging.getLogger(__name__), DOMAIN, hass, SCAN_INTERVAL, DISCOVERY_PLATFORMS) diff --git a/homeassistant/components/switch/__init__.py b/homeassistant/components/switch/__init__.py index a93ba1b95df..f246692560d 100644 --- a/homeassistant/components/switch/__init__.py +++ b/homeassistant/components/switch/__init__.py @@ -6,7 +6,7 @@ Component to interface with various switches that can be controlled remotely. import logging from datetime import timedelta -from homeassistant.helpers.device_component import DeviceComponent +from homeassistant.helpers.entity_component import EntityComponent from homeassistant.const import ( STATE_ON, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID) @@ -58,7 +58,7 @@ def turn_off(hass, entity_id=None): def setup(hass, config): """ Track states and offer events for switches. """ - component = DeviceComponent( + component = EntityComponent( _LOGGER, DOMAIN, hass, SCAN_INTERVAL, DISCOVERY_PLATFORMS, GROUP_NAME_ALL_SWITCHES) component.setup(config) diff --git a/homeassistant/components/thermostat/__init__.py b/homeassistant/components/thermostat/__init__.py index d91c54efa7f..08940b977c9 100644 --- a/homeassistant/components/thermostat/__init__.py +++ b/homeassistant/components/thermostat/__init__.py @@ -6,7 +6,7 @@ Provides functionality to interact with thermostats. """ import logging -from homeassistant.helpers.device_component import DeviceComponent +from homeassistant.helpers.entity_component import EntityComponent import homeassistant.util as util from homeassistant.helpers.entity import Entity @@ -52,7 +52,7 @@ def set_temperature(hass, temperature, entity_id=None): def setup(hass, config): """ Setup thermostats. """ - component = DeviceComponent(_LOGGER, DOMAIN, hass, SCAN_INTERVAL) + component = EntityComponent(_LOGGER, DOMAIN, hass, SCAN_INTERVAL) component.setup(config) def thermostat_service(service): diff --git a/tests/helpers.py b/tests/helpers.py index 2157b46d835..d98c549346d 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -7,7 +7,7 @@ Helper method for writing tests. import os import homeassistant as ha -from homeassistant.helpers.device import ToggleDevice +from homeassistant.helpers.entity import ToggleEntity from homeassistant.const import STATE_ON, STATE_OFF, DEVICE_DEFAULT_NAME @@ -42,7 +42,7 @@ class MockModule(object): self.setup = lambda hass, config: False if setup is None else setup -class MockToggleDevice(ToggleDevice): +class MockToggleDevice(ToggleEntity): """ Provides a mock toggle device. """ def __init__(self, name, state): self._name = name or DEVICE_DEFAULT_NAME