完善自动模式

master
lld 2026-03-06 23:13:44 +08:00
parent e542587200
commit 8aea454417
1 changed files with 6 additions and 0 deletions

View File

@ -63,6 +63,8 @@ public class DeviceStatusHandler {
@Value("${spring.mqtt.latest-ttl-seconds:120}") @Value("${spring.mqtt.latest-ttl-seconds:120}")
private int latestTtlSeconds; private int latestTtlSeconds;
private static final String AUTO_MODE = "auto_mode";
private static final String AUTO_OFF = "autooff";
/** /**
* / * /
*/ */
@ -133,6 +135,10 @@ public class DeviceStatusHandler {
if (lockHolder != null) { if (lockHolder != null) {
sendObj = new JSONObject(payloadObj); // 只在需要时复制 sendObj = new JSONObject(payloadObj); // 只在需要时复制
sendObj.put("clientId", lockHolder); sendObj.put("clientId", lockHolder);
// 如果相等则为自动模式直接退出方法 不转发ack消息 自动关也不应该转发
if (AUTO_MODE.equals(lockHolder) || AUTO_OFF.equals(lockHolder)) {
return;
}
} }
} }
} }