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 451fda8..3974ae4 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,7 +94,8 @@ public class DeviceTelemetry { /** * 舱内温度 temperature */ - public static final TelemetryKey Temperature = TelemetryKey.of( + // 温度 - Double + public static final TelemetryKey TEMPERATURE = TelemetryKey.of( "temperature", Double.class, value -> { @@ -106,10 +107,11 @@ public class DeviceTelemetry { } ); + /** * 舱内湿度 humidity */ - public static final TelemetryKey Humidity = TelemetryKey.of( + public static final TelemetryKey HUMIDITY = TelemetryKey.of( "humidity", Double.class, value -> { @@ -207,31 +209,8 @@ public class DeviceTelemetry { /** * 以下尚未划分 */ - // 温度 - Double - 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()); - } - ); - // 湿度 - Double - 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()); - } - ); + @@ -254,9 +233,8 @@ public class DeviceTelemetry { Sub_Device_Online_Status, Total_Flight_Sorties, Drone_Charge_State_State, - Drone_In_Dock, - Temperature, - HUMIDITY + Drone_In_Dock + ); }