Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions homeassistant/components/abode/cover.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Support for Abode Security System covers."""
import abodepy.helpers.constants as CONST

from homeassistant.components.cover import CoverDevice
from homeassistant.components.cover import CoverEntity

from . import AbodeDevice
from .const import DOMAIN
Expand All @@ -19,7 +19,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(entities)


class AbodeCover(AbodeDevice, CoverDevice):
class AbodeCover(AbodeDevice, CoverEntity):
"""Representation of an Abode cover."""

@property
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/ads/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
SUPPORT_OPEN,
SUPPORT_SET_POSITION,
SUPPORT_STOP,
CoverDevice,
CoverEntity,
)
from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME
import homeassistant.helpers.config_validation as cv
Expand Down Expand Up @@ -78,7 +78,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
)


class AdsCover(AdsEntity, CoverDevice):
class AdsCover(AdsEntity, CoverEntity):
"""Representation of ADS cover."""

def __init__(
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/aladdin_connect/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
PLATFORM_SCHEMA,
SUPPORT_CLOSE,
SUPPORT_OPEN,
CoverDevice,
CoverEntity,
)
from homeassistant.const import (
CONF_PASSWORD,
Expand Down Expand Up @@ -59,7 +59,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
)


class AladdinDevice(CoverDevice):
class AladdinDevice(CoverEntity):
"""Representation of Aladdin Connect cover."""

def __init__(self, acc, device):
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/brunt/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
SUPPORT_CLOSE,
SUPPORT_OPEN,
SUPPORT_SET_POSITION,
CoverDevice,
CoverEntity,
)
from homeassistant.const import ATTR_ATTRIBUTION, CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_validation as cv
Expand Down Expand Up @@ -62,7 +62,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
)


class BruntDevice(CoverDevice):
class BruntDevice(CoverEntity):
"""
Representation of a Brunt cover device.

Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/command_line/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import voluptuous as vol

from homeassistant.components.cover import PLATFORM_SCHEMA, CoverDevice
from homeassistant.components.cover import PLATFORM_SCHEMA, CoverEntity
from homeassistant.const import (
CONF_COMMAND_CLOSE,
CONF_COMMAND_OPEN,
Expand Down Expand Up @@ -63,7 +63,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(covers)


class CommandCover(CoverDevice):
class CommandCover(CoverEntity):
"""Representation a command line cover."""

def __init__(
Expand Down
13 changes: 12 additions & 1 deletion homeassistant/components/cover/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ async def async_unload_entry(hass, entry):
return await hass.data[DOMAIN].async_unload_entry(entry)


class CoverDevice(Entity):
class CoverEntity(Entity):
"""Representation of a cover."""

@property
Expand Down Expand Up @@ -318,3 +318,14 @@ async def async_toggle_tilt(self, **kwargs):
await self.async_open_cover_tilt(**kwargs)
else:
await self.async_close_cover_tilt(**kwargs)


class CoverDevice(CoverEntity):
"""Representation of a cover (for backwards compatibility)."""

def __init_subclass__(cls, **kwargs):
"""Print deprecation warning."""
super().__init_subclass__(**kwargs)
_LOGGER.warning(
"CoverDevice is deprecated, modify %s to extend CoverEntity", cls.__name__,
)
4 changes: 2 additions & 2 deletions homeassistant/components/deconz/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SUPPORT_OPEN,
SUPPORT_SET_POSITION,
SUPPORT_STOP,
CoverDevice,
CoverEntity,
)
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
Expand Down Expand Up @@ -46,7 +46,7 @@ def async_add_cover(lights):
async_add_cover(gateway.api.lights.values())


class DeconzCover(DeconzDevice, CoverDevice):
class DeconzCover(DeconzDevice, CoverEntity):
"""Representation of a deCONZ cover."""

def __init__(self, device, gateway):
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/demo/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ATTR_TILT_POSITION,
SUPPORT_CLOSE,
SUPPORT_OPEN,
CoverDevice,
CoverEntity,
)
from homeassistant.core import callback
from homeassistant.helpers.event import async_track_utc_time_change
Expand Down Expand Up @@ -35,7 +35,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
await async_setup_platform(hass, {}, async_add_entities)


class DemoCover(CoverDevice):
class DemoCover(CoverEntity):
"""Representation of a demo cover."""

def __init__(
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/dynalite/cover.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Support for the Dynalite channels as covers."""
from typing import Callable

from homeassistant.components.cover import DEVICE_CLASSES, CoverDevice
from homeassistant.components.cover import DEVICE_CLASSES, CoverEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback

Expand All @@ -25,7 +25,7 @@ def cover_from_device(device, bridge):
)


class DynaliteCover(DynaliteBase, CoverDevice):
class DynaliteCover(DynaliteBase, CoverEntity):
"""Representation of a Dynalite Channel as a Home Assistant Cover."""

@property
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/esphome/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
SUPPORT_SET_POSITION,
SUPPORT_SET_TILT_POSITION,
SUPPORT_STOP,
CoverDevice,
CoverEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
Expand All @@ -39,7 +39,7 @@ async def async_setup_entry(
)


class EsphomeCover(EsphomeEntity, CoverDevice):
class EsphomeCover(EsphomeEntity, CoverEntity):
"""A cover implementation for ESPHome."""

@property
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/fibaro/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ATTR_POSITION,
ATTR_TILT_POSITION,
DOMAIN,
CoverDevice,
CoverEntity,
)

from . import FIBARO_DEVICES, FibaroDevice
Expand All @@ -23,7 +23,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
)


class FibaroCover(FibaroDevice, CoverDevice):
class FibaroCover(FibaroDevice, CoverEntity):
"""Representation a Fibaro Cover."""

def __init__(self, fibaro_device):
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/garadget/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import requests
import voluptuous as vol

from homeassistant.components.cover import PLATFORM_SCHEMA, CoverDevice
from homeassistant.components.cover import PLATFORM_SCHEMA, CoverEntity
from homeassistant.const import (
CONF_ACCESS_TOKEN,
CONF_COVERS,
Expand Down Expand Up @@ -74,7 +74,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(covers)


class GaradgetCover(CoverDevice):
class GaradgetCover(CoverEntity):
"""Representation of a Garadget cover."""

def __init__(self, hass, args):
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/gogogate2/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pygogogate2 import Gogogate2API as pygogogate2
import voluptuous as vol

from homeassistant.components.cover import SUPPORT_CLOSE, SUPPORT_OPEN, CoverDevice
from homeassistant.components.cover import SUPPORT_CLOSE, SUPPORT_OPEN, CoverEntity
from homeassistant.const import (
CONF_IP_ADDRESS,
CONF_NAME,
Expand Down Expand Up @@ -57,7 +57,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
)


class MyGogogate2Device(CoverDevice):
class MyGogogate2Device(CoverEntity):
"""Representation of a Gogogate2 cover."""

def __init__(self, mygogogate2, device, name):
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/group/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
SUPPORT_SET_TILT_POSITION,
SUPPORT_STOP,
SUPPORT_STOP_TILT,
CoverDevice,
CoverEntity,
)
from homeassistant.const import (
ATTR_ASSUMED_STATE,
Expand Down Expand Up @@ -66,7 +66,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities([CoverGroup(config[CONF_NAME], config[CONF_ENTITIES])])


class CoverGroup(CoverDevice):
class CoverGroup(CoverEntity):
"""Representation of a CoverGroup."""

def __init__(self, name, entities):
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/homekit_controller/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
SUPPORT_SET_POSITION,
SUPPORT_SET_TILT_POSITION,
SUPPORT_STOP,
CoverDevice,
CoverEntity,
)
from homeassistant.const import STATE_CLOSED, STATE_CLOSING, STATE_OPEN, STATE_OPENING
from homeassistant.core import callback
Expand Down Expand Up @@ -58,7 +58,7 @@ def async_add_service(aid, service):
conn.add_listener(async_add_service)


class HomeKitGarageDoorCover(HomeKitEntity, CoverDevice):
class HomeKitGarageDoorCover(HomeKitEntity, CoverEntity):
"""Representation of a HomeKit Garage Door."""

@property
Expand Down Expand Up @@ -128,7 +128,7 @@ def device_state_attributes(self):
return attributes


class HomeKitWindowCover(HomeKitEntity, CoverDevice):
class HomeKitWindowCover(HomeKitEntity, CoverEntity):
"""Representation of a HomeKit Window or Window Covering."""

def get_characteristic_types(self):
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/homematic/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from homeassistant.components.cover import (
ATTR_POSITION,
ATTR_TILT_POSITION,
CoverDevice,
CoverEntity,
)

from .const import ATTR_DISCOVER_DEVICES
Expand All @@ -26,7 +26,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(devices, True)


class HMCover(HMDevice, CoverDevice):
class HMCover(HMDevice, CoverEntity):
"""Representation a HomeMatic Cover."""

@property
Expand Down
10 changes: 5 additions & 5 deletions homeassistant/components/homematicip_cloud/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from homeassistant.components.cover import (
ATTR_POSITION,
ATTR_TILT_POSITION,
CoverDevice,
CoverEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
Expand Down Expand Up @@ -51,7 +51,7 @@ async def async_setup_entry(
async_add_entities(entities)


class HomematicipCoverShutter(HomematicipGenericDevice, CoverDevice):
class HomematicipCoverShutter(HomematicipGenericDevice, CoverEntity):
"""Representation of a HomematicIP Cloud cover shutter device."""

@property
Expand Down Expand Up @@ -88,7 +88,7 @@ async def async_stop_cover(self, **kwargs) -> None:
await self._device.set_shutter_stop()


class HomematicipCoverSlats(HomematicipCoverShutter, CoverDevice):
class HomematicipCoverSlats(HomematicipCoverShutter, CoverEntity):
"""Representation of a HomematicIP Cloud cover slats device."""

@property
Expand Down Expand Up @@ -118,7 +118,7 @@ async def async_stop_cover_tilt(self, **kwargs) -> None:
await self._device.set_shutter_stop()


class HomematicipGarageDoorModuleTormatic(HomematicipGenericDevice, CoverDevice):
class HomematicipGarageDoorModuleTormatic(HomematicipGenericDevice, CoverEntity):
"""Representation of a HomematicIP Garage Door Module for Tormatic."""

@property
Expand Down Expand Up @@ -150,7 +150,7 @@ async def async_stop_cover(self, **kwargs) -> None:
await self._device.send_door_command(DoorCommand.STOP)


class HomematicipCoverShutterGroup(HomematicipCoverSlats, CoverDevice):
class HomematicipCoverShutterGroup(HomematicipCoverSlats, CoverEntity):
"""Representation of a HomematicIP Cloud cover shutter group."""

def __init__(self, hap: HomematicipHAP, device, post: str = "ShutterGroup") -> None:
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/insteon/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
SUPPORT_CLOSE,
SUPPORT_OPEN,
SUPPORT_SET_POSITION,
CoverDevice,
CoverEntity,
)

from .insteon_entity import InsteonEntity
Expand All @@ -34,12 +34,12 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
device.states[state_key].name,
)

new_entity = InsteonCoverDevice(device, state_key)
new_entity = InsteonCoverEntity(device, state_key)

async_add_entities([new_entity])


class InsteonCoverDevice(InsteonEntity, CoverDevice):
class InsteonCoverEntity(InsteonEntity, CoverEntity):
"""A Class for an Insteon device."""

@property
Expand Down
Loading