diff --git a/custom_components/tapo_control/camera.py b/custom_components/tapo_control/camera.py index 81913e9..5e8338d 100644 --- a/custom_components/tapo_control/camera.py +++ b/custom_components/tapo_control/camera.py @@ -7,7 +7,7 @@ from pytapo import Tapo from homeassistant.util import slugify from homeassistant.helpers import entity_platform -from homeassistant.components.camera import SUPPORT_STREAM, Camera +from homeassistant.components.camera import SUPPORT_STREAM, SUPPORT_ON_OFF, Camera from homeassistant.components.ffmpeg import DATA_FFMPEG from homeassistant.helpers.aiohttp_client import ( async_aiohttp_proxy_stream @@ -77,7 +77,7 @@ def __init__(self, hass: HomeAssistant, entry: dict, tapoData: Tapo, HDStream: b @property def supported_features(self): - return SUPPORT_STREAM + return SUPPORT_STREAM | SUPPORT_ON_OFF @property def icon(self) -> str: @@ -277,6 +277,12 @@ async def async_enable_motion_detection(self): async def async_disable_motion_detection(self): await self.hass.async_add_executor_job(self._controller.setMotionDetection, True) await self._coordinator.async_request_refresh() + + async def async_turn_on(self): + await self.set_privacy_mode("off") + + async def async_turn_off(self): + await self.set_privacy_mode("on") async def set_auto_track_mode(self, auto_track_mode: str): if(auto_track_mode == "on"):