From 64662f6f264cade97ed0169fcb70b0eeac4febe2 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:39:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constants/DeviceTelemetry.java | 26 ++++++++++++++++++- 1 file changed, 25 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 6473866..451fda8 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 @@ -94,10 +94,32 @@ public class DeviceTelemetry { /** * 舱内温度 temperature */ + public static final TelemetryKey Temperature = TelemetryKey.of( + "temperature", + Double.class, + value -> { + if (value == null) return null; + if (value instanceof Number) { + return ((Number) value).doubleValue(); + } + return Double.parseDouble(value.toString()); + } + ); /** * 舱内湿度 humidity */ + public static final TelemetryKey Humidity = TelemetryKey.of( + "humidity", + Double.class, + value -> { + if (value == null) return null; + if (value instanceof Number) { + return ((Number) value).doubleValue(); + } + return Double.parseDouble(value.toString()); + } + ); /** @@ -232,7 +254,9 @@ public class DeviceTelemetry { Sub_Device_Online_Status, Total_Flight_Sorties, Drone_Charge_State_State, - Drone_In_Dock + Drone_In_Dock, + Temperature, + HUMIDITY ); }