From b78437444b403ad7b4bf09eb62b6ba95d8ed5ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B0=8F=E4=BA=91?= Date: Mon, 19 Jan 2026 16:58:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constants/DeviceTelemetry.java | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ruoyi/device/domain/model/thingsboard/constants/DeviceTelemetry.java b/src/main/java/com/ruoyi/device/domain/model/thingsboard/constants/DeviceTelemetry.java index 286ebd3..34affe1 100644 --- a/src/main/java/com/ruoyi/device/domain/model/thingsboard/constants/DeviceTelemetry.java +++ b/src/main/java/com/ruoyi/device/domain/model/thingsboard/constants/DeviceTelemetry.java @@ -23,6 +23,34 @@ public class DeviceTelemetry { * 无人机独状态 */ + //wind_speed{"unit_name":"米每秒 / m/s"} float + + public static final TelemetryKey Wind_Speed = TelemetryKey.of( + "wind_speed", + Double.class, + value -> { + if (value == null) return null; + if (value instanceof Number) { + return ((Number) value).doubleValue(); + } + return Double.parseDouble(value.toString()); + } + ); + + //rainfall {"0":"无雨","1":"小雨","2":"中雨","3":"大雨"} enum_int + + public static final TelemetryKey Rainfall = TelemetryKey.of( + "rainfall", + Integer.class, + value -> { + if (value == null) return null; + if (value instanceof Number) { + return ((Number) value).intValue(); + } + return Integer.parseInt(value.toString()); + } + ); + /** * 网络类型 {"1":"4G","2":"以太网"} */ @@ -266,7 +294,9 @@ public class DeviceTelemetry { Drone_Charge_State_State, Drone_In_Dock, Acc_Time, - Network_State_Type + Network_State_Type, + Wind_Speed, + Rainfall ); }