Skip to content

Commit 93c0fd8

Browse files
committed
Allow SmartMonitor HID mode without classic YAML themes
1 parent b15b66d commit 93c0fd8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

library/config.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,20 @@ def copy_default(default, theme):
5454

5555
def load_theme():
5656
global THEME_DATA
57+
theme_path = Path("res/themes/" + CONFIG_DATA['config']['THEME'])
5758
try:
58-
theme_path = Path("res/themes/" + CONFIG_DATA['config']['THEME'])
5959
logger.info("Loading theme %s from %s" % (CONFIG_DATA['config']['THEME'], theme_path / "theme.yaml"))
6060
THEME_DATA = load_yaml(MAIN_DIRECTORY / theme_path / "theme.yaml")
6161
THEME_DATA['PATH'] = str(MAIN_DIRECTORY / theme_path) + "/"
6262
except:
63+
if CONFIG_DATA.get("display", {}).get("REVISION") == "A_HID":
64+
logger.warning(
65+
"Classic YAML theme '%s' is not available in this package; using default fallback for SmartMonitor HID mode",
66+
CONFIG_DATA['config']['THEME'],
67+
)
68+
THEME_DATA = dict(THEME_DEFAULT)
69+
THEME_DATA['PATH'] = str(MAIN_DIRECTORY / "res/themes") + "/"
70+
return
6371
logger.error("Theme not found or contains errors!")
6472
try:
6573
sys.exit(0)

0 commit comments

Comments
 (0)