From 40695fcc06e17dff1d9956004178023f5f52b6cb Mon Sep 17 00:00:00 2001 From: Shay Levy Date: Sat, 4 May 2024 23:05:39 +0300 Subject: [PATCH] Fix HA camera deprecated constant (#337) --- custom_components/dahua/camera.py | 8 ++++---- hacs.json | 2 +- requirements.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/custom_components/dahua/camera.py b/custom_components/dahua/camera.py index b9a82e9..ef40c3f 100755 --- a/custom_components/dahua/camera.py +++ b/custom_components/dahua/camera.py @@ -6,7 +6,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_platform -from homeassistant.components.camera import SUPPORT_STREAM, Camera +from homeassistant.components.camera import Camera, CameraEntityFeature from custom_components.dahua import DahuaDataUpdateCoordinator from custom_components.dahua.entity import DahuaBaseEntity @@ -254,8 +254,8 @@ async def async_camera_image(self, width: int | None = None, height: int | None @property def supported_features(self): - """Return supported features.""" - return SUPPORT_STREAM + """Flag supported features.""" + return CameraEntityFeature.STREAM async def stream_source(self): """Return the RTSP stream source.""" @@ -325,7 +325,7 @@ async def async_adjustfocus(self, focus: str, zoom: str): """ Handles the service call from SERVICE_SET_INFRARED_MODE to set zoom and focus """ await self._coordinator.client.async_adjustfocus_v1(focus, zoom) await self._coordinator.async_refresh() - + async def async_set_privacy_masking(self, index: int, enabled: bool): """ Handles the service call from SERVICE_SET_PRIVACY_MASKING to control the privacy masking """ await self._coordinator.client.async_setprivacymask(index, enabled) diff --git a/hacs.json b/hacs.json index bf3195f..8a35422 100755 --- a/hacs.json +++ b/hacs.json @@ -1,6 +1,6 @@ { "name": "Dahua", "hacs": "1.6.0", - "homeassistant": "2021.7.0", + "homeassistant": "2024.1.0", "render_readme": true } diff --git a/requirements.txt b/requirements.txt index 1687a15..326eaab 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -homeassistant~=2021.7.0 +homeassistant~=2024.1.0 ha-ffmpeg==3.0.2 voluptuous~=0.12.1 aiohttp~=3.7.4.post0