mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-02 20:59:56 -05:00
Controller logs when it takes actions.
This commit is contained in:
parent
ccc6cf78d3
commit
9b3a03012e
9 changed files with 140 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue