mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Short handed device class for overkiz cover (#100394)
This commit is contained in:
parent
89eec9990b
commit
8b7061b634
@ -45,6 +45,17 @@ OVERKIZ_DEVICE_TO_DEVICE_CLASS = {
|
|||||||
class VerticalCover(OverkizGenericCover):
|
class VerticalCover(OverkizGenericCover):
|
||||||
"""Representation of an Overkiz vertical cover."""
|
"""Representation of an Overkiz vertical cover."""
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self, device_url: str, coordinator: OverkizDataUpdateCoordinator
|
||||||
|
) -> None:
|
||||||
|
"""Initialize vertical cover."""
|
||||||
|
super().__init__(device_url, coordinator)
|
||||||
|
self._attr_device_class = (
|
||||||
|
OVERKIZ_DEVICE_TO_DEVICE_CLASS.get(self.device.widget)
|
||||||
|
or OVERKIZ_DEVICE_TO_DEVICE_CLASS.get(self.device.ui_class)
|
||||||
|
or CoverDeviceClass.BLIND
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_features(self) -> CoverEntityFeature:
|
def supported_features(self) -> CoverEntityFeature:
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
@ -64,15 +75,6 @@ class VerticalCover(OverkizGenericCover):
|
|||||||
|
|
||||||
return supported_features
|
return supported_features
|
||||||
|
|
||||||
@property
|
|
||||||
def device_class(self) -> CoverDeviceClass:
|
|
||||||
"""Return the class of the device."""
|
|
||||||
return (
|
|
||||||
OVERKIZ_DEVICE_TO_DEVICE_CLASS.get(self.device.widget)
|
|
||||||
or OVERKIZ_DEVICE_TO_DEVICE_CLASS.get(self.device.ui_class)
|
|
||||||
or CoverDeviceClass.BLIND
|
|
||||||
)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_cover_position(self) -> int | None:
|
def current_cover_position(self) -> int | None:
|
||||||
"""Return current position of cover.
|
"""Return current position of cover.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user