feat(M1): 补 de_wake/de_press_key 工具(Agent 熄屏可自唤醒);修复 MCP SDK v2 input_schema 字段警告
This commit is contained in:
@@ -107,6 +107,18 @@ class PlatformClient:
|
||||
"duration": float(duration)})
|
||||
return self._check_op(r, "swipe")
|
||||
|
||||
def wake(self, serial):
|
||||
"""亮屏并解锁(POST /api/device/screen_all mode=on)。"""
|
||||
r = self._post("/api/device/screen_all",
|
||||
json={"mode": "on", "serials": [serial]})
|
||||
return self._check_op(r, "wake")
|
||||
|
||||
def press_key(self, serial, key):
|
||||
"""按键(POST /api/screen/key)。"""
|
||||
r = self._post("/api/screen/key",
|
||||
json={"serial": serial, "key": key})
|
||||
return self._check_op(r, "key")
|
||||
|
||||
@staticmethod
|
||||
def _check_op(r, name):
|
||||
if r.status_code == 503:
|
||||
|
||||
Reference in New Issue
Block a user