Improve KNX config validation (#50980)
* remove dict repacking * check binary_sensor device_class * check cover device_class * check sensor_type
This commit is contained in:
parent
3141535d69
commit
5ca5b9ac89
3 changed files with 27 additions and 16 deletions
|
@ -12,7 +12,6 @@ from homeassistant.components.cover import (
|
|||
ATTR_POSITION,
|
||||
ATTR_TILT_POSITION,
|
||||
DEVICE_CLASS_BLIND,
|
||||
DEVICE_CLASSES,
|
||||
SUPPORT_CLOSE,
|
||||
SUPPORT_CLOSE_TILT,
|
||||
SUPPORT_OPEN,
|
||||
|
@ -127,7 +126,7 @@ class KNXCover(KnxEntity, CoverEntity):
|
|||
@property
|
||||
def device_class(self) -> str | None:
|
||||
"""Return the class of this device, from component DEVICE_CLASSES."""
|
||||
if self._device_class in DEVICE_CLASSES:
|
||||
if self._device_class:
|
||||
return self._device_class
|
||||
if self._device.supports_angle:
|
||||
return DEVICE_CLASS_BLIND
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue