From bdef7e045c5dcafc81404c008d54a820cbc635a6 Mon Sep 17 00:00:00 2001 From: gaoyoulong <774597026@qq.com> Date: Mon, 29 Apr 2024 11:40:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=89=A9=E6=A8=A1=E5=9E=8B=E6=B6=88?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E8=AE=BE=E5=A4=87=E9=87=8D=E5=A4=8D=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=EF=BC=8C=E7=A6=BB=E7=BA=BF=E8=BF=87=E6=BB=A4=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cc/iotkit/plugin/main/ThingServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iot-module/iot-plugin/iot-plugin-main/src/main/java/cc/iotkit/plugin/main/ThingServiceImpl.java b/iot-module/iot-plugin/iot-plugin-main/src/main/java/cc/iotkit/plugin/main/ThingServiceImpl.java index e412b841..6f9ca6e5 100644 --- a/iot-module/iot-plugin/iot-plugin-main/src/main/java/cc/iotkit/plugin/main/ThingServiceImpl.java +++ b/iot-module/iot-plugin/iot-plugin-main/src/main/java/cc/iotkit/plugin/main/ThingServiceImpl.java @@ -186,6 +186,11 @@ public class ThingServiceImpl implements IThingService { private void deviceStateChange(DeviceInfo device, DeviceStateChange action) { DeviceState state = action.getState(); + if ( (device.getState().isOnline() && state == DeviceState.ONLINE) || + (!device.getState().isOnline() && state == DeviceState.OFFLINE) ) { + return; + } + if (state == DeviceState.ONLINE) { device.getState().setOnline(true); device.getState().setOnlineTime(System.currentTimeMillis());