Skip to content

Commit

Permalink
fix: add open feature for frunk
Browse files Browse the repository at this point in the history
  • Loading branch information
shred86 committed Oct 23, 2022
1 parent 658295f commit 769858f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion custom_components/tesla_custom/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def __init__(
self.type = "frunk"
self._attr_device_class = CoverDeviceClass.DOOR
self._attr_icon = "mdi:car"
self._attr_supported_features = CoverEntityFeature.OPEN

async def async_open_cover(self, **kwargs):
"""Send open cover command."""
Expand All @@ -92,6 +91,15 @@ def is_closed(self):
"""Return True if frunk is closed."""
return self._car.is_frunk_closed

@property
def supported_features(self) -> int:
"""Return supported features."""
# This check is for the trunk, need to find one for frunk
if self._car.powered_lift_gate:
return CoverEntityFeature.OPEN | CoverEntityFeature.CLOSE

return CoverEntityFeature.OPEN


class TeslaCarTrunk(TeslaCarEntity, CoverEntity):
"""Representation of a Tesla car trunk cover."""
Expand Down

0 comments on commit 769858f

Please sign in to comment.