fix(modes): only activate peripherals and show individual seat actions

This commit is contained in:
Miayui
2026-09-22 13:34:29 +08:00
parent 6b9ee0f349
commit 2b365b3922
21 changed files with 176 additions and 215 deletions
+5 -6
View File
@@ -1,12 +1,11 @@
# Web Console
## 浪漫相关模式的外设灯光
## 创建模式时的外设动作
浪漫、约会、纪念日及浪漫影院等模式使用当前持久授权的红外目录:打开灯笼、蜡烛和灯带,
所有具有红色指令的外设灯光统一设置为红色。每台设备均先发送开启指令,再发送红色指令;
开启下发失败时终止后续序列。缺少开启能力的设备不能只发送颜色指令,缺少红色能力时
不以其他颜色替代。新模式生成、车端卡片导入及已有卡片的执行入口均使用该规则,
原生座椅、空调等场景动作保持原有定义。
创建模式时,每个选中的外设只保留一条已授权的开启指令,不加入灯光颜色、亮度或效果设置。
浪漫、约会、纪念日及浪漫影院等模式仍会打开灯笼、蜡烛和灯带,执行时也不会再自动补上红色。
缺少已授权开启能力的外设不能使用调色指令替代。此规则作用于模式创建与自动补齐,
独立的外设调色指令以及车内原生座椅、空调等控制沿用原有逻辑。
## 车端影院模式的副驾姿态
+3 -41
View File
@@ -1079,44 +1079,6 @@
})
.join(" · ");
const passengerComfort = actions
.map((action, index) => ({ action, index }))
.filter(({ action, index }) => !consumed.has(index)
&& ["passenger", "front_right"].includes(targetZone(action))
&& [
"seat.set_ventilation",
"seat.set_backrest_recline",
"seat.set_legrest_height",
].includes(String(action.capability || "")));
const comfortByCapability = new Map(passengerComfort.map(({ action, index }) => [
String(action.capability || ""), { action, index },
]));
if ([
"seat.set_ventilation",
"seat.set_backrest_recline",
"seat.set_legrest_height",
].every((capability) => comfortByCapability.has(capability))) {
const ventilation = parameters(comfortByCapability.get("seat.set_ventilation").action);
const backrest = parameters(comfortByCapability.get("seat.set_backrest_recline").action);
const legrest = parameters(comfortByCapability.get("seat.set_legrest_height").action);
const comfortMentions = ["座椅", "副驾", "舒适"]
.map((term) => instruction.indexOf(term))
.filter((index) => index >= 0);
const comfortOrder = comfortMentions.length
? Math.min(...comfortMentions)
: 10_000 + Math.max(...passengerComfort.map(({ index }) => index));
addRow(
"副驾座椅舒适模式",
[
`通风${ventilation.state === "off" ? "关闭" : `开启 ${ventilation.level ?? 1}档`}`,
`靠背 ${backrest.position_pct ?? "--"}%`,
`腿托 ${legrest.position_pct ?? "--"}%`,
].join(" · "),
"armchair",
comfortOrder,
passengerComfort.map(({ index }) => index),
);
}
actions.forEach((action, index) => {
if (consumed.has(index)) return;
const capability = String(action.capability || "");
@@ -1171,9 +1133,9 @@
const seatLabel = ["passenger", "front_right"].includes(zone) ? "副驾" : "主驾";
const seatCapabilityLabels = {
"seat.set_longitudinal_position": "座椅前后位置",
"seat.set_cushion_tilt": "坐垫角度",
"seat.set_backrest_recline": "靠背角度",
"seat.set_legrest_height": "腿托高度",
"seat.set_cushion_tilt": "坐垫位置",
"seat.set_backrest_recline": "靠背位置",
"seat.set_legrest_height": "腿托位置",
"seat.set_ventilation": "座椅通风",
"seat.set_heating": "座椅加热",
"seat.set_driver_ventilation_native": "座椅通风",
+1 -1
View File
@@ -45,7 +45,7 @@
<script src="/pwa.js?v=android-pad-3" defer></script>
<script src="/console-v2.js?v=local-first-79-cinema-status" defer></script>
<script src="/self-extension.js?v=peripheral-cards-59" defer></script>
<script src="/assistant-chat.js?v=codex-assistant-39-video-media" defer></script>
<script src="/assistant-chat.js?v=codex-assistant-40-seat-rows" defer></script>
<script src="/energy-monitor.js?v=energy-monitor-5-performance" defer></script>
<script src="/firmware-workbench-entry.js?v=3" defer></script>
</head>
+2 -2
View File
@@ -1,4 +1,4 @@
const CACHE_VERSION = "cognitive-agent-pad-v336-seat-preset";
const CACHE_VERSION = "cognitive-agent-pad-v337-seat-rows";
const SHELL_CACHE = `${CACHE_VERSION}-shell`;
const RUNTIME_CACHE = `${CACHE_VERSION}-runtime`;
const APP_SHELL = [
@@ -17,7 +17,7 @@ const APP_SHELL = [
"/speech-input.js?v=sensevoice-13",
"/speech-audio-worklet.js?v=sensevoice-5",
"/assistant-chat.css?v=codex-assistant-30",
"/assistant-chat.js?v=codex-assistant-39-video-media",
"/assistant-chat.js?v=codex-assistant-40-seat-rows",
"/energy-monitor.css?v=energy-monitor-5-dialog-size",
"/energy-monitor.js?v=energy-monitor-5-performance",
"/ui-consistency.css?v=spatial-ui-8",