Skip to content

Commit 40695fc

Browse files
authored
Fix HA camera deprecated constant (#337)
1 parent 2651596 commit 40695fc

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

custom_components/dahua/camera.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from homeassistant.core import HomeAssistant
88
from homeassistant.helpers import entity_platform
9-
from homeassistant.components.camera import SUPPORT_STREAM, Camera
9+
from homeassistant.components.camera import Camera, CameraEntityFeature
1010

1111
from custom_components.dahua import DahuaDataUpdateCoordinator
1212
from custom_components.dahua.entity import DahuaBaseEntity
@@ -254,8 +254,8 @@ async def async_camera_image(self, width: int | None = None, height: int | None
254254

255255
@property
256256
def supported_features(self):
257-
"""Return supported features."""
258-
return SUPPORT_STREAM
257+
"""Flag supported features."""
258+
return CameraEntityFeature.STREAM
259259

260260
async def stream_source(self):
261261
"""Return the RTSP stream source."""
@@ -325,7 +325,7 @@ async def async_adjustfocus(self, focus: str, zoom: str):
325325
""" Handles the service call from SERVICE_SET_INFRARED_MODE to set zoom and focus """
326326
await self._coordinator.client.async_adjustfocus_v1(focus, zoom)
327327
await self._coordinator.async_refresh()
328-
328+
329329
async def async_set_privacy_masking(self, index: int, enabled: bool):
330330
""" Handles the service call from SERVICE_SET_PRIVACY_MASKING to control the privacy masking """
331331
await self._coordinator.client.async_setprivacymask(index, enabled)

hacs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Dahua",
33
"hacs": "1.6.0",
4-
"homeassistant": "2021.7.0",
4+
"homeassistant": "2024.1.0",
55
"render_readme": true
66
}

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
homeassistant~=2021.7.0
1+
homeassistant~=2024.1.0
22
ha-ffmpeg==3.0.2
33
voluptuous~=0.12.1
44
aiohttp~=3.7.4.post0

0 commit comments

Comments
 (0)