添加枚举

This commit is contained in:
孙小云 2026-01-19 16:39:01 +08:00
parent 425ba35452
commit 64662f6f26
1 changed files with 25 additions and 1 deletions

View File

@ -94,10 +94,32 @@ public class DeviceTelemetry {
/** /**
* 舱内温度 temperature * 舱内温度 temperature
*/ */
public static final TelemetryKey<Double> 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 * 舱内湿度 humidity
*/ */
public static final TelemetryKey<Double> 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, Sub_Device_Online_Status,
Total_Flight_Sorties, Total_Flight_Sorties,
Drone_Charge_State_State, Drone_Charge_State_State,
Drone_In_Dock Drone_In_Dock,
Temperature,
HUMIDITY
); );
} }