Skip to content

Commit

Permalink
Update device.py
Browse files Browse the repository at this point in the history
Remove commented out code
  • Loading branch information
rbtying authored Jun 23, 2023
1 parent bdd08b4 commit 68cf5c1
Showing 1 changed file with 0 additions and 69 deletions.
69 changes: 0 additions & 69 deletions custom_components/onvif_ptz/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,75 +404,6 @@ async def async_perform_ptz_relative(
req.Speed = speed
LOGGER.debug("Making RelativeMove request %s", req)
await ptz_service.RelativeMove(req)
# if move_mode == CONTINUOUS_MOVE:
# # Guard against unsupported operation
# if not profile.ptz or not profile.ptz.continuous:
# LOGGER.warning(
# "ContinuousMove not supported on device '%s'", self.name
# )
# return

# velocity = {}
# if pan is not None or tilt is not None:
# velocity["PanTilt"] = {"x": pan_val, "y": tilt_val}
# if zoom is not None:
# velocity["Zoom"] = {"x": zoom_val}

# req.Velocity = velocity

# await ptz_service.ContinuousMove(req)
# await asyncio.sleep(continuous_duration)
# req = ptz_service.create_type("Stop")
# req.ProfileToken = profile.token
# await ptz_service.Stop(
# {"ProfileToken": req.ProfileToken, "PanTilt": True, "Zoom": False}
# )
# elif move_mode == RELATIVE_MOVE:
# Guard against unsupported operation
# elif move_mode == ABSOLUTE_MOVE:
# # Guard against unsupported operation
# if not profile.ptz or not profile.ptz.absolute:
# LOGGER.warning(
# "AbsoluteMove not supported on device '%s'", self.name
# )
# return

# req.Position = {
# "PanTilt": {"x": pan_val, "y": tilt_val},
# "Zoom": {"x": zoom_val},
# }
# req.Speed = {
# "PanTilt": {"x": speed_val, "y": speed_val},
# "Zoom": {"x": speed_val},
# }
# await ptz_service.AbsoluteMove(req)
# elif move_mode == GOTOPRESET_MOVE:
# # Guard against unsupported operation
# if not profile.ptz or not profile.ptz.presets:
# LOGGER.warning(
# "Absolute Presets not supported on device '%s'", self.name
# )
# return
# if preset_val not in profile.ptz.presets:
# LOGGER.warning(
# (
# "PTZ preset '%s' does not exist on device '%s'. Available"
# " Presets: %s"
# ),
# preset_val,
# self.name,
# ", ".join(profile.ptz.presets),
# )
# return

# req.PresetToken = preset_val
# req.Speed = {
# "PanTilt": {"x": speed_val, "y": speed_val},
# "Zoom": {"x": speed_val},
# }
# await ptz_service.GotoPreset(req)
# elif move_mode == STOP_MOVE:
# await ptz_service.Stop(req)
except ONVIFError as err:
if "Bad Request" in err.reason:
LOGGER.warning("Device '%s' doesn't support PTZ", self.name)
Expand Down

0 comments on commit 68cf5c1

Please sign in to comment.