From 68cf5c1f0c3317b7e4aa17d7ac0d28f242ca71cb Mon Sep 17 00:00:00 2001 From: Robert Ying Date: Thu, 22 Jun 2023 21:51:17 -0700 Subject: [PATCH] Update device.py Remove commented out code --- custom_components/onvif_ptz/device.py | 69 --------------------------- 1 file changed, 69 deletions(-) diff --git a/custom_components/onvif_ptz/device.py b/custom_components/onvif_ptz/device.py index 5507da0..644fb0f 100644 --- a/custom_components/onvif_ptz/device.py +++ b/custom_components/onvif_ptz/device.py @@ -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)