fix(piper): normalize int-like ctrl_mode enum to int

这个提交包含在:
Elvin
2026-03-07 12:07:54 +08:00
父节点 5e1d1cc999
当前提交 70c4b2d665

查看文件

@ -83,7 +83,7 @@ def _piper_mode_to_int(value: Any) -> int | None:
if isinstance(value, bool): if isinstance(value, bool):
return int(value) return int(value)
if isinstance(value, int): if isinstance(value, int):
return value return int(value)
if hasattr(value, "value") and isinstance(value.value, int): if hasattr(value, "value") and isinstance(value.value, int):
return int(value.value) return int(value.value)
if hasattr(value, "__int__"): if hasattr(value, "__int__"):