Skip to content

Commit

Permalink
set avaliables
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 committed Feb 5, 2024
1 parent f8addfa commit 1da4878
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions custom_components/teslemetry/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ def __init__(
super().__init__(data, description.key)
self.entity_description = description

@property
def avaliable(self) -> bool:
"""Return if the cover is available."""
return True

async def async_press(self) -> None:
"""Press the button."""
await self.wake_up_if_asleep()
Expand Down
20 changes: 20 additions & 0 deletions custom_components/teslemetry/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ def __init__(self, data: TeslemetryVehicleData, scoped) -> None:
if not scoped:
self._attr_supported_features = CoverEntityFeature(0)

@property
def avaliable(self) -> bool:
"""Return if the cover is available."""
return True

@property
def is_closed(self) -> bool | None:
"""Return if the cover is closed or not."""
Expand Down Expand Up @@ -101,6 +106,11 @@ def __init__(self, vehicle: TeslemetryVehicleData, scoped) -> None:
if not scoped:
self._attr_supported_features = CoverEntityFeature(0)

@property
def avaliable(self) -> bool:
"""Return if the cover is available."""
return True

@property
def is_closed(self) -> bool | None:
"""Return if the cover is closed or not."""
Expand Down Expand Up @@ -135,6 +145,11 @@ def __init__(self, vehicle: TeslemetryVehicleData, scoped) -> None:
if not scoped:
self._attr_supported_features = CoverEntityFeature(0)

@property
def avaliable(self) -> bool:
"""Return if the cover is available."""
return True

@property
def is_closed(self) -> bool | None:
"""Return if the cover is closed or not."""
Expand All @@ -161,6 +176,11 @@ def __init__(self, vehicle: TeslemetryVehicleData, scoped) -> None:
if not scoped:
self._attr_supported_features = CoverEntityFeature(0)

@property
def avaliable(self) -> bool:
"""Return if the cover is available."""
return True

@property
def is_closed(self) -> bool | None:
"""Return if the cover is closed or not."""
Expand Down

0 comments on commit 1da4878

Please sign in to comment.