feat: 完善 N7 智能座舱交互与控制链路
This commit is contained in:
@@ -162,6 +162,28 @@ class VerifiedBodyCanTests(unittest.TestCase):
|
||||
)
|
||||
self.runtime.compile(config)
|
||||
|
||||
def test_compressor_catalog_action_cannot_reuse_hvac_power_frame(self) -> None:
|
||||
action = {
|
||||
"capability": "climate.set_ac",
|
||||
"target": "vehicle",
|
||||
"parameters": {"state": "on"},
|
||||
}
|
||||
|
||||
self.assertFalse(self.runtime.supports(action))
|
||||
self.assertNotIn("climate.set_ac", self.runtime.supported_capabilities)
|
||||
with self.assertRaisesRegex(NativeCanCompileError, "no HIL-verified physical"):
|
||||
self.runtime._frame_specs(
|
||||
{
|
||||
"capability": "climate.set_ac",
|
||||
"target": {"zone": "vehicle"},
|
||||
"parameters": {"state": "on"},
|
||||
}
|
||||
)
|
||||
with self.assertRaises(NativeCanCompileError):
|
||||
self.runtime.build_function_config(
|
||||
"climate", [action], "reject-unverified-compressor", "local_rules"
|
||||
)
|
||||
|
||||
def test_exact_parser_exposes_only_verified_light_vocabulary(self) -> None:
|
||||
self.assertEqual(_parse_exact_command("light wall on"), [])
|
||||
self.assertEqual(_parse_exact_command("light reading front-left on"), [])
|
||||
@@ -177,6 +199,54 @@ class VerifiedBodyCanTests(unittest.TestCase):
|
||||
)
|
||||
self.assertEqual(brightness[0]["parameters"], {"brightness_level": 5})
|
||||
|
||||
def test_all_cabin_lights_off_expands_to_verified_light_controls(self) -> None:
|
||||
parsed = merge_native_can_intent(
|
||||
{
|
||||
"actions": [],
|
||||
"domain_actions": [],
|
||||
"native_can_actions": [],
|
||||
"deferred_requests": [],
|
||||
"model_requests": [],
|
||||
"detected_domains": [],
|
||||
"ambiguities": [],
|
||||
"decision_summary": [],
|
||||
},
|
||||
"灯光全部关闭",
|
||||
)
|
||||
|
||||
actions = parsed["native_can_actions"]
|
||||
self.assertEqual(
|
||||
[
|
||||
(
|
||||
action["capability"],
|
||||
action["target"],
|
||||
action["parameters"],
|
||||
)
|
||||
for action in actions
|
||||
],
|
||||
[
|
||||
(
|
||||
"interior_light.set_indoor_power",
|
||||
"vehicle",
|
||||
{"state": "off"},
|
||||
),
|
||||
(
|
||||
"interior_light.set_reading_power",
|
||||
"all",
|
||||
{"state": "off"},
|
||||
),
|
||||
(
|
||||
"ambient_light.set_power",
|
||||
"vehicle",
|
||||
{"state": "off"},
|
||||
),
|
||||
],
|
||||
)
|
||||
self.assertTrue(all(self.runtime.supports(action) for action in actions))
|
||||
self.assertEqual(
|
||||
parsed["detected_domains"], ["interior_light", "ambient_light"]
|
||||
)
|
||||
|
||||
def test_fully_exact_ac_power_is_the_only_executable_plan(self) -> None:
|
||||
for requested_state in ("on", "off"):
|
||||
opposite_state = "off" if requested_state == "on" else "on"
|
||||
|
||||
Reference in New Issue
Block a user