Skip to content

Commit

Permalink
updated camera control access messages
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Oct 4, 2024
1 parent 4746445 commit 05b1a73
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions care/utils/assetintegration/onvif.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,30 +185,30 @@ def handle_action(self, action, user): # noqa: PLR0911
if action_type == self.OnvifActions.LOCK_CAMERA.value:
if camera_manager.lock_camera():
return {

Check warning on line 187 in care/utils/assetintegration/onvif.py

View check run for this annotation

Codecov / codecov/patch

care/utils/assetintegration/onvif.py#L187

Added line #L187 was not covered by tests
"message": "Camera is now locked",
"message": "You now have access to the camera controls, the camera is locked for other users",
"camera_user": camera_manager.current_user(),
}

raise PermissionDenied(

Check warning on line 192 in care/utils/assetintegration/onvif.py

View check run for this annotation

Codecov / codecov/patch

care/utils/assetintegration/onvif.py#L192

Added line #L192 was not covered by tests
{
"message": "Camera is currently in used by another user",
"message": "Camera is currently in used by another user, you have been added to the waiting list for camera controls access",
"camera_user": camera_manager.current_user(),
}
)

if action_type == self.OnvifActions.UNLOCK_CAMERA.value:
camera_manager.unlock_camera()
return {"message": "Camera is now unlocked"}
return {"message": "Camera controls unlocked"}

Check warning on line 201 in care/utils/assetintegration/onvif.py

View check run for this annotation

Codecov / codecov/patch

care/utils/assetintegration/onvif.py#L200-L201

Added lines #L200 - L201 were not covered by tests

if action_type == self.OnvifActions.REQUEST_ACCESS.value:
if camera_manager.request_access():
return {

Check warning on line 205 in care/utils/assetintegration/onvif.py

View check run for this annotation

Codecov / codecov/patch

care/utils/assetintegration/onvif.py#L205

Added line #L205 was not covered by tests
"message": "Access to camera granted",
"message": "Access to camera camera controls granted",
"camera_user": camera_manager.current_user(),
}

return {

Check warning on line 210 in care/utils/assetintegration/onvif.py

View check run for this annotation

Codecov / codecov/patch

care/utils/assetintegration/onvif.py#L210

Added line #L210 was not covered by tests
"message": "Requested access to camera",
"message": "Requested access to camera controls, waiting for current user to release",
"camera_user": camera_manager.current_user(),
}

Expand All @@ -229,7 +229,7 @@ def handle_action(self, action, user): # noqa: PLR0911
if not camera_manager.has_access():
raise PermissionDenied(

Check warning on line 230 in care/utils/assetintegration/onvif.py

View check run for this annotation

Codecov / codecov/patch

care/utils/assetintegration/onvif.py#L230

Added line #L230 was not covered by tests
{
"message": "Camera is currently in used by another user",
"message": "Camera is currently in used by another user, you have been added to the waiting list for camera controls access",
"camera_user": camera_manager.current_user(),
}
)
Expand Down

0 comments on commit 05b1a73

Please sign in to comment.