Use EntityFeature enum in switch_as_x (#69442)

This commit is contained in:
epenet 2022-04-07 07:14:10 +02:00 committed by GitHub
parent a6f112df80
commit f11f1db177
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@ from __future__ import annotations
from typing import Any
from homeassistant.components.cover import SUPPORT_CLOSE, SUPPORT_OPEN, CoverEntity
from homeassistant.components.cover import CoverEntity, CoverEntityFeature
from homeassistant.components.switch.const import DOMAIN as SWITCH_DOMAIN
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
@ -48,7 +48,7 @@ async def async_setup_entry(
class CoverSwitch(BaseEntity, CoverEntity):
"""Represents a Switch as a Cover."""
_attr_supported_features = SUPPORT_OPEN | SUPPORT_CLOSE
_attr_supported_features = CoverEntityFeature.OPEN | CoverEntityFeature.CLOSE
async def async_open_cover(self, **kwargs: Any) -> None:
"""Open the cover."""