feat(Q1,Q4): add HighlightsConfig, KioskConfig, HIGHLIGHT/TIMELAPSE triggers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
23d5bf062a
commit
d69bf6d6af
@ -109,6 +109,25 @@ def test_vigilar_config_has_location():
|
||||
assert cfg.location.latitude == 0.0
|
||||
|
||||
|
||||
def test_highlights_config_defaults():
|
||||
from vigilar.config import HighlightsConfig
|
||||
assert HighlightsConfig().enabled is True
|
||||
assert HighlightsConfig().generate_time == "06:00"
|
||||
|
||||
def test_kiosk_config_defaults():
|
||||
from vigilar.config import KioskConfig
|
||||
assert KioskConfig().ambient_enabled is True
|
||||
assert KioskConfig().camera_rotation_s == 10
|
||||
|
||||
def test_recording_trigger_highlight():
|
||||
from vigilar.constants import RecordingTrigger
|
||||
assert RecordingTrigger.HIGHLIGHT == "HIGHLIGHT"
|
||||
|
||||
def test_recording_trigger_timelapse():
|
||||
from vigilar.constants import RecordingTrigger
|
||||
assert RecordingTrigger.TIMELAPSE == "TIMELAPSE"
|
||||
|
||||
|
||||
class TestCameraConfigLocation:
|
||||
def test_default_location_is_interior(self):
|
||||
from vigilar.config import CameraConfig
|
||||
|
||||
@ -297,6 +297,27 @@ class VisitorsConfig(BaseModel):
|
||||
face_crop_dir: str = "/var/vigilar/faces"
|
||||
|
||||
|
||||
# --- Highlights Config ---
|
||||
|
||||
class HighlightsConfig(BaseModel):
|
||||
enabled: bool = True
|
||||
generate_time: str = "06:00"
|
||||
max_clips: int = 10
|
||||
clip_duration_s: int = 5
|
||||
cameras: list[str] = Field(default_factory=list)
|
||||
event_types: list[str] = Field(default_factory=list)
|
||||
|
||||
|
||||
class KioskConfig(BaseModel):
|
||||
ambient_enabled: bool = True
|
||||
camera_rotation_s: int = 10
|
||||
alert_timeout_s: int = 30
|
||||
predator_alert_timeout_s: int = 60
|
||||
dim_start: str = "23:00"
|
||||
dim_end: str = "06:00"
|
||||
highlight_play_time: str = "07:00"
|
||||
|
||||
|
||||
# --- Location Config ---
|
||||
|
||||
class LocationConfig(BaseModel):
|
||||
@ -358,6 +379,8 @@ class VigilarConfig(BaseModel):
|
||||
health: HealthConfig = Field(default_factory=HealthConfig)
|
||||
pets: PetsConfig = Field(default_factory=PetsConfig)
|
||||
visitors: VisitorsConfig = Field(default_factory=VisitorsConfig)
|
||||
highlights: HighlightsConfig = Field(default_factory=HighlightsConfig)
|
||||
kiosk: KioskConfig = Field(default_factory=KioskConfig)
|
||||
security: SecurityConfig = Field(default_factory=SecurityConfig)
|
||||
location: LocationConfig = Field(default_factory=LocationConfig)
|
||||
cameras: list[CameraConfig] = Field(default_factory=list)
|
||||
|
||||
@ -82,6 +82,8 @@ class RecordingTrigger(StrEnum):
|
||||
VEHICLE = "VEHICLE"
|
||||
PET = "PET"
|
||||
WILDLIFE = "WILDLIFE"
|
||||
HIGHLIGHT = "HIGHLIGHT"
|
||||
TIMELAPSE = "TIMELAPSE"
|
||||
|
||||
|
||||
# --- Alert Channels ---
|
||||
|
||||
Loading…
Reference in New Issue
Block a user