feat: implement background color and night mode settings in the TV control app
All checks were successful
Build App / build (push) Successful in 7m10s

This commit is contained in:
2026-03-01 17:53:41 +01:00
parent 37bf9c74cb
commit eb4e7ea26a
6 changed files with 541 additions and 72 deletions

View File

@@ -18,7 +18,15 @@ DEFAULT_STATE = {
},
"data_cards": [],
"settings": {
"background_url": ""
"background_url": "",
"background_color": "#000000",
"night_mode": {
"enabled": False,
"start_time": "22:00",
"end_time": "07:00",
"message": "Good Night",
"dim_background": True
}
}
}
@@ -106,9 +114,16 @@ def main(args):
_write_state(current)
return {"status": "success"}
elif route == "push_settings":
bg_url = body.get("background_url", "")
current = _read_state()
current.setdefault("settings", {})["background_url"] = bg_url
settings = current.setdefault("settings", {})
# Merge scalar settings keys
for key in ["background_url", "background_color"]:
if key in body:
settings[key] = body[key]
# Deep-merge night_mode sub-object
if "night_mode" in body:
nm = settings.setdefault("night_mode", {})
nm.update(body["night_mode"])
_write_state(current)
return {"status": "success"}
elif route == "push_upload_images":