From 50a7f4a6aca3051aed83ccd73eb5f2e94889aeee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BD=B3=E6=B6=9B?= Date: Fri, 6 Aug 2021 16:44:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E9=87=8D=E5=A4=8D=E4=B8=8B?= =?UTF-8?q?=E7=BA=BF=E5=88=A4=E6=96=AD=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hekr/iotos/softgateway/core/network/mqtt/MqttService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework-core/src/main/java/me/hekr/iotos/softgateway/core/network/mqtt/MqttService.java b/framework-core/src/main/java/me/hekr/iotos/softgateway/core/network/mqtt/MqttService.java index b0fd126..b48a8aa 100644 --- a/framework-core/src/main/java/me/hekr/iotos/softgateway/core/network/mqtt/MqttService.java +++ b/framework-core/src/main/java/me/hekr/iotos/softgateway/core/network/mqtt/MqttService.java @@ -319,12 +319,12 @@ public class MqttService { if (!iotOsConfig.getGatewayConfig().getPk().equals(pk)) { DeviceRemoteConfig dev = DeviceRemoteConfig.getByPkAndDevId(pk, devId).get(); - if (klink instanceof DevLogin) { + if (klink instanceof DevLogin && dev.isOffline()) { dev.setOnline(); return; } - if (klink instanceof DevLogout && dev.isOffline()) { + if (klink instanceof DevLogout && dev.isOnline()) { dev.setOffline(); return; } -- Gitee