mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-10 16:52:47 +03:00
* Implement hardware detection and UI management * Cleanup Frigate+ detection * Don't count model as changed * Fixes for audio map error * Add descriptions * Enforce that all model must exist * Fix hardware picking * Docs fixes * WebUI cleanup * Cleanup handling of scenes * UI refinement * Cleanup recommended UI * test fixews
31 lines
803 B
Python
31 lines
803 B
Python
"""Hardware discovery APIs."""
|
|
|
|
import logging
|
|
|
|
from fastapi import APIRouter, Depends
|
|
|
|
from frigate.api.auth import require_role
|
|
from frigate.api.defs.tags import Tags
|
|
from frigate.detectors.hardware import DetectionHardware, hardware_prober
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
router = APIRouter(tags=[Tags.hardware])
|
|
|
|
|
|
@router.get(
|
|
"/hardware/probe",
|
|
response_model=list[DetectionHardware],
|
|
dependencies=[Depends(require_role(["admin"]))],
|
|
)
|
|
def probe_hardware(refresh: bool = False) -> list[DetectionHardware]:
|
|
"""Get the object detection hardware attached to this system.
|
|
|
|
Args:
|
|
refresh: Probe again instead of returning the cached result
|
|
|
|
Returns:
|
|
Every kind of detection hardware that was found
|
|
"""
|
|
return hardware_prober.probe(refresh=refresh)
|