mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-19 19:06:16 +01:00
fix birdseye config
This commit is contained in:
parent
b86b2d6602
commit
a1afade9ba
@ -326,7 +326,8 @@ class BirdseyeConfig(FrigateBaseModel):
|
||||
)
|
||||
|
||||
|
||||
class BirdseyeCameraConfig(FrigateBaseModel):
|
||||
# uses BaseModel because some global attributes are not available at the camera level
|
||||
class BirdseyeCameraConfig(BaseModel):
|
||||
enabled: bool = Field(default=True, title="Enable birdseye view for camera.")
|
||||
mode: BirdseyeModeEnum = Field(
|
||||
default=BirdseyeModeEnum.objects, title="Tracking mode for camera."
|
||||
|
@ -84,7 +84,7 @@ class TestConfig(unittest.TestCase):
|
||||
def test_override_birdseye(self):
|
||||
config = {
|
||||
"mqtt": {"host": "mqtt"},
|
||||
"birdseye": { "enabled": True, "mode": "continuous" },
|
||||
"birdseye": {"enabled": True, "mode": "continuous"},
|
||||
"cameras": {
|
||||
"back": {
|
||||
"ffmpeg": {
|
||||
@ -97,10 +97,7 @@ class TestConfig(unittest.TestCase):
|
||||
"width": 1920,
|
||||
"fps": 5,
|
||||
},
|
||||
"birdseye": {
|
||||
"enabled": False,
|
||||
"mode": "motion"
|
||||
},
|
||||
"birdseye": {"enabled": False, "mode": "motion"},
|
||||
}
|
||||
},
|
||||
}
|
||||
@ -111,10 +108,10 @@ class TestConfig(unittest.TestCase):
|
||||
assert not runtime_config.cameras["back"].birdseye.enabled
|
||||
assert runtime_config.cameras["back"].birdseye.mode is BirdseyeModeEnum.motion
|
||||
|
||||
def test_inherit_birdseye(self):
|
||||
def test_override_birdseye_non_inheritable(self):
|
||||
config = {
|
||||
"mqtt": {"host": "mqtt"},
|
||||
"birdseye": { "enabled": True, "mode": "continuous" },
|
||||
"birdseye": {"enabled": True, "mode": "continuous", "height": 1920},
|
||||
"cameras": {
|
||||
"back": {
|
||||
"ffmpeg": {
|
||||
@ -135,7 +132,34 @@ class TestConfig(unittest.TestCase):
|
||||
|
||||
runtime_config = frigate_config.runtime_config
|
||||
assert runtime_config.cameras["back"].birdseye.enabled
|
||||
assert runtime_config.cameras["back"].birdseye.mode is BirdseyeModeEnum.continuous
|
||||
|
||||
def test_inherit_birdseye(self):
|
||||
config = {
|
||||
"mqtt": {"host": "mqtt"},
|
||||
"birdseye": {"enabled": True, "mode": "continuous"},
|
||||
"cameras": {
|
||||
"back": {
|
||||
"ffmpeg": {
|
||||
"inputs": [
|
||||
{"path": "rtsp://10.0.0.1:554/video", "roles": ["detect"]}
|
||||
]
|
||||
},
|
||||
"detect": {
|
||||
"height": 1080,
|
||||
"width": 1920,
|
||||
"fps": 5,
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
frigate_config = FrigateConfig(**config)
|
||||
assert config == frigate_config.dict(exclude_unset=True)
|
||||
|
||||
runtime_config = frigate_config.runtime_config
|
||||
assert runtime_config.cameras["back"].birdseye.enabled
|
||||
assert (
|
||||
runtime_config.cameras["back"].birdseye.mode is BirdseyeModeEnum.continuous
|
||||
)
|
||||
|
||||
def test_override_tracked_objects(self):
|
||||
config = {
|
||||
|
Loading…
Reference in New Issue
Block a user