优化无线/有线CAN,以及控制指令解析
This commit is contained in:
@@ -96,6 +96,44 @@ class MultiDomainServiceTests(unittest.TestCase):
|
||||
self.addCleanup(self.temporary_directory.cleanup)
|
||||
self.service.artifact_root = Path(self.temporary_directory.name)
|
||||
|
||||
def test_driver_massage_mode_and_strength_continuations_compile_locally(
|
||||
self,
|
||||
) -> None:
|
||||
result = self.service.preview_native_can(
|
||||
"打开主驾座椅按摩,模式切换为脉冲模式,强度调到最大",
|
||||
provider="auto",
|
||||
conversation_id="conv-driver-massage-pulse-strong",
|
||||
execution_mode="dry_run",
|
||||
)
|
||||
self.assertEqual(result["unresolved_clauses"], [])
|
||||
self.assertFalse(result["supplement_required"])
|
||||
commands = [
|
||||
command
|
||||
for plan in result.get("command_plans", {}).values()
|
||||
for command in plan.get("spec", {}).get("commands", [])
|
||||
]
|
||||
self.assertEqual(
|
||||
[command["signals"]["debug_command"] for command in commands],
|
||||
[
|
||||
"seat driver massage mode pulse",
|
||||
"seat driver massage strength strong",
|
||||
],
|
||||
)
|
||||
self.assertEqual(
|
||||
[command["signals"]["data_hex"] for command in commands],
|
||||
[
|
||||
"12 00 00 03 00 00 00 00",
|
||||
"12 03 00 00 00 00 00 00",
|
||||
],
|
||||
)
|
||||
self.assertTrue(
|
||||
all(
|
||||
operation["parse_source"] == "local_rule"
|
||||
for config in result.get("function_configs", {}).values()
|
||||
for operation in config.get("spec", {}).get("operations", [])
|
||||
)
|
||||
)
|
||||
|
||||
def test_four_domain_scene_is_generated_executed_and_persisted(self) -> None:
|
||||
model_output = {
|
||||
"detected_domains": ["seat", "climate", "roof", "ambient_light"],
|
||||
|
||||
Reference in New Issue
Block a user