Refactor birdseye activity modes as a list and add alerts/detections (#24012)

* backend

* tests

* frontend and i18n

* e2e test schema

* docs
This commit is contained in:
Josh Hawkins
2026-09-12 07:30:04 -06:00
committed by Nicolas Mowen
parent e77155a4f1
commit f4cf1e1539
29 changed files with 583 additions and 425 deletions
+13 -6
View File
@@ -533,19 +533,26 @@ def _convert_legacy_mask_to_dict(
return result
# the 0.18 scalar Birdseye modes, mapped to their activity mode names
_LEGACY_BIRDSEYE_MODES = {
"continuous": "continuous",
"motion": "motion",
"objects": "all_objects",
}
def _migrate_birdseye_mode(birdseye: dict[str, Any] | None) -> None:
"""Convert a scalar Birdseye mode to composable activity types."""
"""Convert a scalar Birdseye mode to an activity mode list."""
if not birdseye or not isinstance(birdseye.get("mode"), str):
return
legacy_mode = birdseye["mode"]
activity_types = ("continuous", "motion", "objects", "stationary_objects")
if legacy_mode not in activity_types:
if legacy_mode not in _LEGACY_BIRDSEYE_MODES:
return
birdseye["mode"] = {
activity_type: activity_type == legacy_mode for activity_type in activity_types
}
del birdseye["mode"]
birdseye["modes"] = [_LEGACY_BIRDSEYE_MODES[legacy_mode]]
def migrate_018_0(config: dict[str, dict[str, Any]]) -> dict[str, dict[str, Any]]: