Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions app/callbacks/live_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from dash import ALL, Input, Output, State, ctx, html, no_update
from dash.exceptions import PreventUpdate
from main import app
from reolink_api_client import ReolinkAPIClient # type: ignore
from pyro_camera_api_client.client import PyroCameraAPIClient # type: ignore
from translations import translate

import config as cfg
Expand Down Expand Up @@ -59,8 +59,8 @@ def fetch_cameras_from_pi(site_name, available_stream):
logger.info(f"Querying Pi at: {pi_api_url}")

try:
# Use the ReolinkAPIClient instead of the old fetch_cameras
client = ReolinkAPIClient(pi_api_url)
# Use the PyroCameraAPIClient instead of the old fetch_cameras
client = PyroCameraAPIClient(pi_api_url)
data = client.get_camera_infos() # this calls /info/camera_infos

pi_cameras = {}
Expand Down Expand Up @@ -160,7 +160,7 @@ def start_stream(camera_name, current_camera, pi_api_url, lang):
raise PreventUpdate

# Create a new client instance safely
client = ReolinkAPIClient(pi_api_url)
client = PyroCameraAPIClient(pi_api_url)

try:
logger.info(f"[start_stream] Stoping patrol for {camera_ip}")
Expand Down Expand Up @@ -224,7 +224,7 @@ def control_camera(current_camera, up, down, left, right, stop, zoom_level, move
raise PreventUpdate

# Instantiate the API client
client = ReolinkAPIClient(pi_api_url)
client = PyroCameraAPIClient(pi_api_url)

direction_map = {
"move-up": "Up",
Expand Down Expand Up @@ -295,7 +295,7 @@ def move_by_click(click_data, current_camera, zoom_value, pi_api_url):
raise PreventUpdate

# Instantiate the API client
client = ReolinkAPIClient(pi_api_url)
client = PyroCameraAPIClient(pi_api_url)

# --- 1. Extract click position ---
x_percent = round((click_data["offsetX"] / click_data["width"]) * 100, 2)
Expand Down Expand Up @@ -438,7 +438,7 @@ def stream_management(

# === Periodic check: is stream still alive? ===
if triggered == "stream-check-interval" and not is_inactive_open:
client = ReolinkAPIClient(pi_api_url)
client = PyroCameraAPIClient(pi_api_url)
result = client.is_stream_running(camera_ip)

if not result.get("running", True):
Expand Down Expand Up @@ -468,7 +468,7 @@ def open_capture_modal(n_clicks, current_camera, api_url):

try:
# Instantiate the API client
client = ReolinkAPIClient(api_url)
client = PyroCameraAPIClient(api_url)

# Capture the image using the client
img = client.capture_image(camera_ip)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dash-leaflet = "^0.1.28"
dash-extensions = "^1.0.0"
pandas = ">=2.1.4"
pyroclient = { git = "https://github.com/pyronear/pyro-api.git", branch = "main", subdirectory = "client" }
reolink_api_client = { git = "https://github.com/pyronear/pyro-engine.git", branch = "develop", subdirectory = "reolink_api/client" }
pyro_camera_api_client = { git = "https://github.com/pyronear/pyro-engine.git", branch = "main", subdirectory = "pyro_camera_api/client" }
python-dotenv = ">=1.0.0"
geopy = ">=2.4.0"
sentry-sdk = { version = "^1.5.12", extras = ["flask"] }
Expand Down
Loading