feat(n7web): enhance control workflows and status feedback
This commit is contained in:
@@ -943,7 +943,7 @@ class SelfExtensionTests(unittest.TestCase):
|
||||
self.assertFalse(result["physical_state_confirmed"])
|
||||
self.assertEqual(len(result["device_response"]), 2)
|
||||
|
||||
def test_main_orchestration_resolves_only_live_bound_nfc_peripheral(self) -> None:
|
||||
def test_main_orchestration_uses_durable_binding_after_card_is_removed(self) -> None:
|
||||
catalog = [
|
||||
{
|
||||
"id": "cap-third-party-light-on",
|
||||
@@ -978,16 +978,25 @@ class SelfExtensionTests(unittest.TestCase):
|
||||
self.assertIsNone(
|
||||
resolve_active_peripheral_command("打开氛围灯", catalog, present)
|
||||
)
|
||||
self.assertIsNone(
|
||||
self.assertEqual(
|
||||
resolve_active_peripheral_command(
|
||||
"打开第三方氛围灯", catalog, {"card": None}
|
||||
)
|
||||
)["id"],
|
||||
"cap-third-party-light-on",
|
||||
)
|
||||
self.assertIsNone(
|
||||
self.assertEqual(
|
||||
resolve_active_peripheral_command(
|
||||
"打开第三方氛围灯",
|
||||
catalog,
|
||||
{"card": {"uid": "FFFFFFFF"}},
|
||||
)["id"],
|
||||
"cap-third-party-light-on",
|
||||
)
|
||||
self.assertIsNone(
|
||||
resolve_active_peripheral_command(
|
||||
"打开第三方氛围灯",
|
||||
[{**catalog[0], "card_uid": ""}],
|
||||
{"card": None},
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1059,6 +1068,17 @@ class SelfExtensionTests(unittest.TestCase):
|
||||
)
|
||||
|
||||
self.assertEqual([item["id"] for item in selected], ["on", "red"])
|
||||
self.assertEqual(
|
||||
[
|
||||
item["id"]
|
||||
for item in active_peripheral_plan_catalog(
|
||||
"打开第三方氛围灯,红灯闪烁5s后关闭",
|
||||
catalog,
|
||||
{"card": None},
|
||||
)
|
||||
],
|
||||
["on", "red"],
|
||||
)
|
||||
self.assertEqual(
|
||||
active_peripheral_plan_catalog(
|
||||
"打开第三方氛围灯",
|
||||
@@ -1351,7 +1371,18 @@ class SelfExtensionTests(unittest.TestCase):
|
||||
)
|
||||
self.assertEqual(
|
||||
[item["status"] for item in result["operation_results"]],
|
||||
["failed"],
|
||||
["failed", "aborted"],
|
||||
)
|
||||
self.assertEqual(
|
||||
result["operation_results"][1]["message"],
|
||||
"前序红外指令失败,未执行",
|
||||
)
|
||||
self.assertEqual(
|
||||
result["operation_results"][1]["telemetry"]["delivery_status"],
|
||||
"not_submitted",
|
||||
)
|
||||
self.assertFalse(
|
||||
result["operation_results"][1]["telemetry"]["transport_submitted"]
|
||||
)
|
||||
|
||||
def test_power_on_then_white_waits_800ms_and_continues_without_ack(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user