Change device class of window covers to shade (#47129)

This commit is contained in:
Robert Svensson 2021-02-27 21:09:25 +01:00 committed by GitHub
parent 97b59023d1
commit da309ce342
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,8 @@
from homeassistant.components.cover import ( from homeassistant.components.cover import (
ATTR_POSITION, ATTR_POSITION,
ATTR_TILT_POSITION, ATTR_TILT_POSITION,
DEVICE_CLASS_WINDOW, DEVICE_CLASS_DAMPER,
DEVICE_CLASS_SHADE,
DOMAIN, DOMAIN,
SUPPORT_CLOSE, SUPPORT_CLOSE,
SUPPORT_CLOSE_TILT, SUPPORT_CLOSE_TILT,
@ -80,9 +81,9 @@ class DeconzCover(DeconzDevice, CoverEntity):
def device_class(self): def device_class(self):
"""Return the class of the cover.""" """Return the class of the cover."""
if self._device.type in DAMPERS: if self._device.type in DAMPERS:
return "damper" return DEVICE_CLASS_DAMPER
if self._device.type in WINDOW_COVERS: if self._device.type in WINDOW_COVERS:
return DEVICE_CLASS_WINDOW return DEVICE_CLASS_SHADE
@property @property
def current_cover_position(self): def current_cover_position(self):