diff --git a/src/control_reolink_cam.py b/src/control_reolink_cam.py index 44e5fcb6..99142ce4 100644 --- a/src/control_reolink_cam.py +++ b/src/control_reolink_cam.py @@ -24,7 +24,6 @@ def main(): - `move_in_seconds`: Moves the camera in a specified direction for a certain duration. - `get_ptz_preset`: Retrieves the list of PTZ preset positions. - `set_ptz_preset`: Sets a PTZ preset position. - - `delete_ptz_preset`: Deletes a PTZ preset position. - `reboot_camera`: Reboots the camera. - `get_auto_focus`: Retrieves the current auto-focus settings. - `set_auto_focus`: Enables or disables the auto-focus. @@ -46,9 +45,6 @@ def main(): - Set a PTZ preset at position 1: python src/control_reolink_cam.py set_ptz_preset --ip 169.254.40.1 --pos_id 1 - - Delete a PTZ preset at position 1: - python src/control_reolink_cam.py delete_ptz_preset --ip 169.254.40.1 --pos_id 1 - - Reboot the camera: python src/control_reolink_cam.py reboot_camera --ip 169.254.40.1 --type ptz @@ -76,7 +72,6 @@ def main(): "move_in_seconds", "get_ptz_preset", "set_ptz_preset", - "delete_ptz_preset", "reboot_camera", "get_auto_focus", "set_auto_focus", @@ -130,11 +125,6 @@ def main(): camera_controller.set_ptz_preset(idx=args.pos_id) else: print("Position ID must be provided for setting a PTZ preset.") - elif args.action == "delete_ptz_preset": - if args.pos_id is not None: - camera_controller.delete_ptz_preset(idx=args.pos_id) - else: - print("Position ID must be provided for deleting a PTZ preset.") elif args.action == "reboot_camera": camera_controller.reboot_camera() print("Camera reboot initiated.") diff --git a/tests/test_sensors.py b/tests/test_sensors.py index d3d6dda8..3300ba2c 100644 --- a/tests/test_sensors.py +++ b/tests/test_sensors.py @@ -103,32 +103,6 @@ def test_move_in_seconds(): mock_move_camera.assert_any_call("Stop") -def test_delete_ptz_preset_success(): - # Mock the response of requests.post to return a successful response for deleting preset - mock_response = MagicMock() - mock_response.status_code = 200 - mock_response.json.return_value = [{"code": 0}] - - with patch("requests.post", return_value=mock_response): - camera = ReolinkCamera("192.168.1.1", "login", "pwd", "ptz") - camera.delete_ptz_preset(idx=1) - # Assert that the delete_ptz_preset method was called successfully - assert mock_response.json.call_count == 1 - - -def test_delete_ptz_preset_failure(): - # Mock the response of requests.post to return a failed response - mock_response = MagicMock() - mock_response.status_code = 200 - mock_response.json.return_value = [{"code": 1, "error": "Some error"}] - - with patch("requests.post", return_value=mock_response): - camera = ReolinkCamera("192.168.1.1", "login", "pwd", "ptz") - camera.delete_ptz_preset(idx=1) - # Assert that a failed operation logs an error message - assert mock_response.json.call_count == 1 - - def test_reboot_camera_success(): # Mock the response of requests.post to return a successful response for reboot mock_response = MagicMock()