fix(pipeline): Fix config module reference in pipeline_runner

- Import engine config module as engine_config to avoid name collision
- Fix UnboundLocalError when accessing config.MESSAGE_DISPLAY_SECS
This commit is contained in:
2026-03-21 15:32:41 -07:00
parent 018778dd11
commit a747f67f63

View File

@@ -314,14 +314,17 @@ def run_pipeline_mode(preset_name: str = "demo"):
# Add message overlay stage if enabled
if getattr(preset, "enable_message_overlay", False):
from engine import config as engine_config
from engine.pipeline.adapters import MessageOverlayConfig
overlay_config = MessageOverlayConfig(
enabled=True,
display_secs=config.MESSAGE_DISPLAY_SECS
if hasattr(config, "MESSAGE_DISPLAY_SECS")
display_secs=engine_config.MESSAGE_DISPLAY_SECS
if hasattr(engine_config, "MESSAGE_DISPLAY_SECS")
else 30,
topic_url=config.NTFY_TOPIC if hasattr(config, "NTFY_TOPIC") else None,
topic_url=engine_config.NTFY_TOPIC
if hasattr(engine_config, "NTFY_TOPIC")
else None,
)
pipeline.add_stage(
"message_overlay", MessageOverlayStage(config=overlay_config)
@@ -643,15 +646,16 @@ def run_pipeline_mode(preset_name: str = "demo"):
# Add message overlay stage if enabled
if getattr(new_preset, "enable_message_overlay", False):
from engine import config as engine_config
from engine.pipeline.adapters import MessageOverlayConfig
overlay_config = MessageOverlayConfig(
enabled=True,
display_secs=config.MESSAGE_DISPLAY_SECS
if hasattr(config, "MESSAGE_DISPLAY_SECS")
display_secs=engine_config.MESSAGE_DISPLAY_SECS
if hasattr(engine_config, "MESSAGE_DISPLAY_SECS")
else 30,
topic_url=config.NTFY_TOPIC
if hasattr(config, "NTFY_TOPIC")
topic_url=engine_config.NTFY_TOPIC
if hasattr(engine_config, "NTFY_TOPIC")
else None,
)
pipeline.add_stage(