diff --git a/frigate/data_processing/post/api.py b/frigate/data_processing/post/api.py index c341bd8ef..89e179dc6 100644 --- a/frigate/data_processing/post/api.py +++ b/frigate/data_processing/post/api.py @@ -5,6 +5,7 @@ from abc import ABC, abstractmethod from typing import Any from frigate.config import FrigateConfig +from frigate.config.enrichment_updater import EnrichmentConfigEnum from ..types import DataProcessorMetrics, DataProcessorModelRunner, PostProcessDataEnum @@ -50,3 +51,18 @@ class PostProcessorApi(ABC): None if request was not handled, otherwise return response. """ pass + + def update_config( + self, update_type: EnrichmentConfigEnum, payload: Any + ) -> None: + """Handle a config change notification. + + Called for every config update published under ``config/``. + Processors should override this to check the update type and act + only on changes relevant to them. Default is a no-op. + + Args: + update_type: The enrichment config type that changed. + payload: The updated configuration object. + """ + pass diff --git a/frigate/data_processing/real_time/api.py b/frigate/data_processing/real_time/api.py index 0fa0f9952..11158b0a9 100644 --- a/frigate/data_processing/real_time/api.py +++ b/frigate/data_processing/real_time/api.py @@ -7,6 +7,7 @@ from typing import Any import numpy as np from frigate.config import FrigateConfig +from frigate.config.enrichment_updater import EnrichmentConfigEnum from ..types import DataProcessorMetrics @@ -61,3 +62,18 @@ class RealTimeProcessorApi(ABC): None. """ pass + + def update_config( + self, update_type: EnrichmentConfigEnum, payload: Any + ) -> None: + """Handle a config change notification. + + Called for every config update published under ``config/``. + Processors should override this to check the update type and act + only on changes relevant to them. Default is a no-op. + + Args: + update_type: The enrichment config type that changed. + payload: The updated configuration object. + """ + pass