Skip to content

Make wsdl_dir path resolving more robust #10967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions frigate/ptz/onvif.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Configure and control camera via onvif."""

import logging
import site
from enum import Enum
from importlib.util import find_spec
from pathlib import Path

import numpy
from onvif import ONVIFCamera, ONVIFError
Expand Down Expand Up @@ -50,10 +51,7 @@ def __init__(
cam.onvif.port,
cam.onvif.user,
cam.onvif.password,
wsdl_dir=site.getsitepackages()[0].replace(
"dist-packages", "site-packages"
)
+ "/wsdl",
wsdl_dir=Path(find_spec("onvif").origin).parent / "../wsdl",
),
"init": False,
"active": False,
Expand Down