From e7a71ea3c33eb16b4e55598ab2e07c73238df109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Fri, 1 Aug 2025 21:00:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B2=A1=E6=9C=89=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E9=81=A5=E6=8E=A7=E5=99=A8=E7=9A=84=E6=97=B6=E5=80=99=E7=94=B5?= =?UTF-8?q?=E9=87=8F=E8=B5=8BNULL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iflytop/handacid/app/core/listener/BleGamepadEventListener.java | 2 +- .../java/com/iflytop/handacid/app/core/state/RemoteControlState.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/iflytop/handacid/app/core/listener/BleGamepadEventListener.java b/src/main/java/com/iflytop/handacid/app/core/listener/BleGamepadEventListener.java index 9d4a41e..9b28282 100644 --- a/src/main/java/com/iflytop/handacid/app/core/listener/BleGamepadEventListener.java +++ b/src/main/java/com/iflytop/handacid/app/core/listener/BleGamepadEventListener.java @@ -70,7 +70,7 @@ public class BleGamepadEventListener { } else if (CmdId.event_ble_gamepad_disconnected.equals(cmdId)) { log.info("蓝牙手柄 连接断开"); deviceState.getRemoteControlState().setConnected(false); - deviceState.getRemoteControlState().setBatteryLevel(-1); + deviceState.getRemoteControlState().setBatteryLevel(null); deviceState.getRemoteControlState().setCharging(false); } diff --git a/src/main/java/com/iflytop/handacid/app/core/state/RemoteControlState.java b/src/main/java/com/iflytop/handacid/app/core/state/RemoteControlState.java index 40e0eaa..c1a7f74 100644 --- a/src/main/java/com/iflytop/handacid/app/core/state/RemoteControlState.java +++ b/src/main/java/com/iflytop/handacid/app/core/state/RemoteControlState.java @@ -19,7 +19,7 @@ public class RemoteControlState { private volatile boolean connected = false; @Schema(description = "当前电量(0-100%)") - private volatile double batteryLevel = -1; + private volatile Integer batteryLevel; @Schema(description = "是否正在充电") private volatile boolean charging = false;