优化后端

This commit is contained in:
Miayui
2026-09-11 17:56:56 +08:00
parent 7eed11b774
commit 812e67422d
7299 changed files with 1744959 additions and 112 deletions
@@ -377,14 +377,18 @@ def decode_feedback(frame: CanFrame) -> dict[str, Any]:
"rear_brightness_level": (
rear_brightness_raw - 1 if 1 <= rear_brightness_raw <= 6 else None
),
# Sheet1 rows 1896-1897 define 0x01-0x1F as colors and
# 0x20-0x7F as reserved. Do not expose a reserved raw value
# as though it were a real cabin color.
# 0x42E carries a 7-bit vehicle-profile color index. The
# generic matrix labels 0x20-0x7F as reserved, but the N7
# 127-color profile and its verified control/HIL contract use
# the complete 0x01-0x7F range. Preserve that authoritative
# index for display and feedback matching; zero remains the
# matrix-defined invalid value. Exact RGB still cannot be
# inferred from this frame.
"front_color_index": (
front_color if 1 <= front_color <= 0x1F else None
front_color if 1 <= front_color <= 0x7F else None
),
"rear_color_index": (
rear_color if 1 <= rear_color <= 0x1F else None
rear_color if 1 <= rear_color <= 0x7F else None
),
},
}