Skip to content

Commit

Permalink
warn when using parameter getter and setter
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasNeugebauer committed Jan 17, 2025
1 parent f8b51b7 commit cb8a308
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion rosys/vision/rtsp_camera/rtsp_camera.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import warnings
from typing import Any

from typing_extensions import Self
Expand Down Expand Up @@ -38,7 +39,7 @@ def __init__(self,
self.ip: str | None = ip

self.substream = jovision_profile or substream
self._register_parameter('jovision_profile', self.get_substream, self.set_substream,
self._register_parameter('jovision_profile', self.get_jovision_profile, self.set_jovision_profile,
min_value=0, max_value=1, step=1, default_value=substream)
self._register_parameter('substream', self.get_substream, self.set_substream,
min_value=0, max_value=1, step=1, default_value=substream)
Expand Down Expand Up @@ -125,6 +126,18 @@ async def get_fps(self) -> int | None:

return await self.device.get_fps()

def get_jovision_profile(self) -> int | None:
assert self.device is not None
warnings.warn('get_jovision_profile is deprecated, use get_substream instead', stacklevel=3)

return self.device.get_substream()

def set_jovision_profile(self, profile: int) -> None:
assert self.device is not None
warnings.warn('set_jovision_profile is deprecated, use set_substream instead', stacklevel=3)

self.device.set_substream(profile)

def set_substream(self, index: int) -> None:
assert self.device is not None

Expand Down

0 comments on commit cb8a308

Please sign in to comment.