Controller logs when it takes actions.

This commit is contained in:
Roland 2026-03-14 10:03:11 -06:00
parent ccc6cf78d3
commit 9b3a03012e
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
9 changed files with 140 additions and 13 deletions

View file

@ -6,6 +6,7 @@ from controller.yaml on the WROLPi drive after it's mounted.
"""
import copy
import logging
import os
from pathlib import Path
from typing import Any
@ -14,6 +15,8 @@ import yaml
from controller.defaults import DEFAULT_CONFIG
logger = logging.getLogger(__name__)
# Path to config file on the WROLPi drive
CONFIG_PATH_ON_DRIVE = Path("/media/wrolpi/config/controller.yaml")
@ -91,7 +94,7 @@ def reload_config_from_drive() -> bool:
drive_config = yaml.safe_load(f) or {}
except (IOError, yaml.YAMLError) as e:
# Failed to load - keep defaults
print(f"Warning: Failed to load controller.yaml: {e}")
logger.warning("Failed to load controller.yaml: %s", e)
return False
# Deep merge: drive_config overrides defaults