Add device_class to Shelly cover domain (#46894)

Fix author
This commit is contained in:
Simone Chemelli 2021-02-22 14:31:22 +01:00 committed by GitHub
parent 36b56586de
commit 82a9dc620c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@ from aioshelly import Block
from homeassistant.components.cover import (
ATTR_POSITION,
DEVICE_CLASS_SHUTTER,
SUPPORT_CLOSE,
SUPPORT_OPEN,
SUPPORT_SET_POSITION,
@ -75,6 +76,11 @@ class ShellyCover(ShellyBlockEntity, CoverEntity):
"""Flag supported features."""
return self._supported_features
@property
def device_class(self) -> str:
"""Return the class of the device."""
return DEVICE_CLASS_SHUTTER
async def async_close_cover(self, **kwargs):
"""Close cover."""
self.control_result = await self.block.set_state(go="close")