* Make buttons consistent and have hover state

* Use switch for camera to be consistent

* Use everywhere and remove unused

* Use green for normal stats color

* Fix logs copy icon

* Remove warnings from pydantic serialization

* Ignore warnings

* Fix wsdl resolution

* Fix loading on switch
This commit is contained in:
Nicolas Mowen
2024-04-16 14:55:24 -06:00
committed by GitHub
parent a823a18496
commit 9be5951076
14 changed files with 106 additions and 95 deletions

View File

@@ -139,7 +139,7 @@ def stats_history():
def config():
config_obj: FrigateConfig = current_app.frigate_config
config: dict[str, dict[str, any]] = config_obj.model_dump(
mode="json", exclude_none=True
mode="json", warnings="none", exclude_none=True
)
# remove the mqtt password

View File

@@ -1351,11 +1351,12 @@ class FrigateConfig(FrigateBaseModel):
"timestamp_style": ...,
},
exclude_unset=True,
warnings="none",
)
for name, camera in config.cameras.items():
merged_config = deep_merge(
camera.model_dump(exclude_unset=True), global_config
camera.model_dump(exclude_unset=True, warnings="none"), global_config
)
camera_config: CameraConfig = CameraConfig.model_validate(
{"name": name, **merged_config}
@@ -1466,7 +1467,7 @@ class FrigateConfig(FrigateBaseModel):
# Set runtime filter to create masks
camera_config.objects.filters[object] = RuntimeFilterConfig(
frame_shape=camera_config.frame_shape,
**filter.model_dump(exclude_unset=True),
**filter.model_dump(exclude_unset=True, warnings="none"),
)
# Convert motion configuration
@@ -1478,7 +1479,9 @@ class FrigateConfig(FrigateBaseModel):
camera_config.motion = RuntimeMotionConfig(
frame_shape=camera_config.frame_shape,
raw_mask=camera_config.motion.mask,
**camera_config.motion.model_dump(exclude_unset=True),
**camera_config.motion.model_dump(
exclude_unset=True, warnings="none"
),
)
camera_config.motion.enabled_in_config = camera_config.motion.enabled
@@ -1515,7 +1518,9 @@ class FrigateConfig(FrigateBaseModel):
for key, detector in config.detectors.items():
adapter = TypeAdapter(DetectorConfig)
model_dict = (
detector if isinstance(detector, dict) else detector.model_dump()
detector
if isinstance(detector, dict)
else detector.model_dump(warnings="none")
)
detector_config: DetectorConfig = adapter.validate_python(model_dict)
if detector_config.model is None:
@@ -1536,8 +1541,8 @@ class FrigateConfig(FrigateBaseModel):
"Customizing more than a detector model path is unsupported."
)
merged_model = deep_merge(
detector_config.model.model_dump(exclude_unset=True),
config.model.model_dump(exclude_unset=True),
detector_config.model.model_dump(exclude_unset=True, warnings="none"),
config.model.model_dump(exclude_unset=True, warnings="none"),
)
if "path" not in merged_model:

View File

@@ -51,7 +51,9 @@ class OnvifController:
cam.onvif.port,
cam.onvif.user,
cam.onvif.password,
wsdl_dir=Path(find_spec("onvif").origin).parent / "../wsdl",
wsdl_dir=str(
Path(find_spec("onvif").origin).parent / "wsdl"
).replace("dist-packages/onvif", "site-packages"),
),
"init": False,
"active": False,