From 325777598d13b0e2ac3b817fb4996ab60e019b2f Mon Sep 17 00:00:00 2001 From: sgottscho <31044871+sgottscho@users.noreply.github.com> Date: Wed, 26 Oct 2022 22:36:44 -0400 Subject: [PATCH] fix: add missing close_cover for frunks closes #307 --- custom_components/tesla_custom/cover.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/custom_components/tesla_custom/cover.py b/custom_components/tesla_custom/cover.py index bd8e9507..c0d04ae8 100644 --- a/custom_components/tesla_custom/cover.py +++ b/custom_components/tesla_custom/cover.py @@ -79,6 +79,13 @@ def __init__( self._attr_device_class = CoverDeviceClass.DOOR self._attr_icon = "mdi:car" + async def async_close_cover(self, **kwargs): + """Send close cover command.""" + _LOGGER.debug("Closing cover: %s", self.name) + if self.is_closed is False: + await self._car.toggle_frunk() + await self.async_update_ha_state() + async def async_open_cover(self, **kwargs): """Send open cover command.""" _LOGGER.debug("Opening cover: %s", self.name)