修改枚举
This commit is contained in:
parent
64662f6f26
commit
a876c6c310
|
|
@ -94,7 +94,8 @@ public class DeviceTelemetry {
|
|||
/**
|
||||
* 舱内温度 temperature
|
||||
*/
|
||||
public static final TelemetryKey<Double> Temperature = TelemetryKey.of(
|
||||
// 温度 - Double
|
||||
public static final TelemetryKey<Double> TEMPERATURE = TelemetryKey.of(
|
||||
"temperature",
|
||||
Double.class,
|
||||
value -> {
|
||||
|
|
@ -106,10 +107,11 @@ public class DeviceTelemetry {
|
|||
}
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* 舱内湿度 humidity
|
||||
*/
|
||||
public static final TelemetryKey<Double> Humidity = TelemetryKey.of(
|
||||
public static final TelemetryKey<Double> HUMIDITY = TelemetryKey.of(
|
||||
"humidity",
|
||||
Double.class,
|
||||
value -> {
|
||||
|
|
@ -207,31 +209,8 @@ public class DeviceTelemetry {
|
|||
/**
|
||||
* 以下尚未划分
|
||||
*/
|
||||
// 温度 - Double
|
||||
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());
|
||||
}
|
||||
);
|
||||
|
||||
// 湿度 - Double
|
||||
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());
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue