Skip to content

Commit

Permalink
take into accound garage door
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrilp committed Mar 3, 2024
1 parent 21d71dd commit c4ad717
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
13 changes: 9 additions & 4 deletions custom_components/deltadore_tydom/ha_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -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."""
Expand Down
6 changes: 6 additions & 0 deletions custom_components/deltadore_tydom/tydom/tydom_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down

0 comments on commit c4ad717

Please sign in to comment.