Browse Source

坐标问题

hotfix/redundant-cleanup
root 3 months ago
parent
commit
76c35df231
  1. 12
      app/services/swipe_service.py
  2. 6
      docs/modify.md

12
app/services/swipe_service.py

@ -30,8 +30,8 @@ class SwipeService:
try:
# 使用auto_discovery_adb_service获取屏幕尺寸
result = await self.auto_discovery_adb_service.execute_shell_command(device_id, "wm size")
if result.get("success"):
output = result.get("output", "")
if result.success:
output = result.output
m = re.search(r"(\d+)\s*x\s*(\d+)", output)
if m:
w, h = int(m.group(1)), int(m.group(2))
@ -39,8 +39,8 @@ class SwipeService:
# 备用方案:dumpsys display
result = await self.auto_discovery_adb_service.execute_shell_command(device_id, "dumpsys display")
if result.get("success"):
output = result.get("output", "")
if result.success:
output = result.output
m = re.search(r"(\d+)\s*x\s*(\d+)", output)
if m:
w, h = int(m.group(1)), int(m.group(2))
@ -145,8 +145,8 @@ class SwipeService:
# 使用auto_discovery_adb_service执行命令
result = await self.auto_discovery_adb_service.execute_shell_command(device_id, swipe_command)
if not result.get("success"):
error_msg = result.get("error", "Unknown error")
if not result.success:
error_msg = result.error or "Unknown error"
logger.error(f"ADB滑动命令执行失败: {error_msg}")
return {
"success": False,

6
docs/modify.md

@ -1446,7 +1446,7 @@ if success:
else EventType.DEVICE_DISCONNECTED.value)
# 获取合并后的设备信息(包含详细属性)
merged_device_info = {}
merged_device_info = device_info or {}
if device_id in self._auto_discovered_devices:
merged_device_info = self._auto_discovered_devices[device_id].get("device_info", {})
@ -3442,7 +3442,7 @@ async def _send_loop(self):
- ✅ heartbeat_channel 和 send_channel 保持分离
- ✅ 在心跳插入前检查 send_channel 状态
- ✅ 简化了发送循环,移除了复杂的优先级机制
- ✅ 保持了架构的清和简洁
- ✅ 保持了架构的清和简洁
- ✅ 每个适配器只处理自己的 channel,职责明确
- ✅ 添加了详细的调试日志,便于跟踪心跳发送状态
@ -4730,7 +4730,7 @@ logger = get_structured_logger(__name__)
- `app/services/atx_service.py` - 移除不存在的atx schema导入
**修复内容**:
```python
```
# 修复前(有问题)
from app.utils.structured_log import get_structured_logger, LogLevel
logger = get_structured_logger(__name__, LogLevel.INFO)

Loading…
Cancel
Save