diff --git a/custom_components/deltadore_tydom/ha_entities.py b/custom_components/deltadore_tydom/ha_entities.py index 04444b8..6ff39ec 100644 --- a/custom_components/deltadore_tydom/ha_entities.py +++ b/custom_components/deltadore_tydom/ha_entities.py @@ -784,9 +784,11 @@ class HaGarage(CoverEntity, HAEntity): """Representation of a Garage door.""" should_poll = False - supported_features = None + supported_features = CoverEntityFeature.OPEN device_class = CoverDeviceClass.GARAGE - sensor_classes = {} + sensor_classes = { + "thermic_defect": BinarySensorDeviceClass.PROBLEM, + } def __init__(self, device: TydomGarage, hass) -> None: """Initialize the sensor.""" @@ -807,9 +809,12 @@ def device_info(self) -> DeviceInfo: @property def is_closed(self) -> bool: - """Return if the window is closed.""" + """Return if the garage door is closed.""" return None - #return self._device.openState == "LOCKED" + + async def async_open_cover(self, **kwargs: Any) -> None: + """Open the cover.""" + await self._device.open() class HaLight(LightEntity, HAEntity): """Representation of a Light.""" diff --git a/custom_components/deltadore_tydom/tydom/tydom_devices.py b/custom_components/deltadore_tydom/tydom/tydom_devices.py index 710ade9..ccb229e 100644 --- a/custom_components/deltadore_tydom/tydom/tydom_devices.py +++ b/custom_components/deltadore_tydom/tydom/tydom_devices.py @@ -242,6 +242,12 @@ class TydomGate(TydomDevice): class TydomGarage(TydomDevice): """represents a garage door.""" + async def open(self) -> None: + """Tell garage door to open.""" + await self._tydom_client.put_devices_data( + self._id, self._endpoint, "levelCmd", "TOGGLE" + ) + class TydomLight(TydomDevice): """represents a light."""