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(
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=[],
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": {
"type": "openvino",
"model": {"path": "/openvino_model.xml"}
},
},
# 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()
assert runtime_config.cameras["back"].onvif.autotracking.movement_weights == [
"0.0",
"1.0",
"1.23",
"2.34",
"0.5",
0.0,
1.0,
1.23,
2.34,
0.5,
]
def test_fails_invalid_movement_weights(self):