Fix movement weights type

This commit is contained in:
Nicolas Mowen 2024-02-28 15:06:30 -07:00
parent 676ab65cba
commit 5b15a75145
2 changed files with 7 additions and 6 deletions

View File

@ -189,7 +189,7 @@ class PtzAutotrackConfig(FrigateBaseModel):
timeout: int = Field( timeout: int = Field(
default=10, title="Seconds to delay before returning to preset." default=10, title="Seconds to delay before returning to preset."
) )
movement_weights: Optional[Union[str, List[str]]] = Field( movement_weights: Optional[Union[str, List[float]]] = Field(
default=[], default=[],
title="Internal value used for PTZ movements based on the speed of your camera's motor.", title="Internal value used for PTZ movements based on the speed of your camera's motor.",
) )

View File

@ -83,6 +83,7 @@ class TestConfig(unittest.TestCase):
}, },
"openvino": { "openvino": {
"type": "openvino", "type": "openvino",
"model": {"path": "/openvino_model.xml"}
}, },
}, },
# needs to be a file that will exist, doesnt matter what # needs to be a file that will exist, doesnt matter what
@ -1534,11 +1535,11 @@ class TestConfig(unittest.TestCase):
runtime_config = frigate_config.runtime_config() runtime_config = frigate_config.runtime_config()
assert runtime_config.cameras["back"].onvif.autotracking.movement_weights == [ assert runtime_config.cameras["back"].onvif.autotracking.movement_weights == [
"0.0", 0.0,
"1.0", 1.0,
"1.23", 1.23,
"2.34", 2.34,
"0.5", 0.5,
] ]
def test_fails_invalid_movement_weights(self): def test_fails_invalid_movement_weights(self):