Skip to content

Commit

Permalink
Add supported ptz_guard and ptz_callibrate
Browse files Browse the repository at this point in the history
  • Loading branch information
starkillerOG committed Feb 20, 2023
1 parent 9a705d8 commit d87d6b0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion reolink_aio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,10 @@ def construct_capabilities(self) -> None:
self._capabilities[channel].append("auto_focus")
if ptz_ver in [2, 3, 5]:
self._capabilities[channel].append("pan_tilt")
if self.api_version("supportPtzCalibration", channel) > 0 or self.api_version("supportPtzCheck", channel) > 0:
self._capabilities[channel].append("ptz_callibrate")
if self.api_version("GetPtzGuard", channel) > 0:
self._capabilities[channel].append("ptz_guard")
if ptz_ver in [2, 3]:
self._capabilities[channel].append("ptz_speed")
if channel in self._ptz_presets and len(self._ptz_presets[channel]) != 0:
Expand Down Expand Up @@ -1055,6 +1059,7 @@ async def get_host_data(self) -> None:
ch_body.append({"cmd": "GetZoomFocus", "action": 1, "param": {"channel": channel}})
if self.supported(channel, "pan_tilt") and self.api_version("ptzPreset", channel) >= 1:
ch_body.append({"cmd": "GetPtzPreset", "action": 0, "param": {"channel": channel}})
ch_body.append({"cmd": "GetPtzGuard", "action": 0, "param": {"channel": channel}})
# checking API versions
if self.api_version("scheduleVersion") >= 1:
ch_body.extend(
Expand Down Expand Up @@ -1089,6 +1094,7 @@ def check_command_exists(cmd: str) -> int:
self._api_version["GetEvents"] = check_command_exists("GetEvents")
self._api_version["GetWhiteLed"] = check_command_exists("GetWhiteLed")
self._api_version["GetAudioCfg"] = check_command_exists("GetAudioCfg")
self._api_version["GetPtzGuard"] = check_command_exists("GetPtzGuard")
if self.api_version("scheduleVersion") >= 1:
self._api_version["GetEmail"] = check_command_exists("GetEmailV20")
self._api_version["GetPush"] = check_command_exists("GetPushV20")
Expand Down Expand Up @@ -1378,7 +1384,7 @@ async def get_rtsp_stream_source(self, channel: int, stream: Optional[str] = Non

if encoding is None:
_LOGGER.debug(
"Host %s:%s rtsp stream: GetRtspUrl unavailable, GetEnc incomplete, falling back to h264 encoding for channel %i, Enc: %s",
"Host %s:%s rtsp stream: GetEnc incomplete, GetRtspUrl unavailable, falling back to h264 encoding for channel %i, Enc: %s",
self._host,
self._port,
channel,
Expand Down

0 comments on commit d87d6b0

Please sign in to comment.