远程遥控相关
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
enum ControlModeTarget {
|
||||
autonomous(2),
|
||||
remote(3);
|
||||
|
||||
const ControlModeTarget(this.value);
|
||||
final int value;
|
||||
}
|
||||
|
||||
/// 仅来自当前设备实时状态,不使用设备列表的静态字段。
|
||||
class DeviceControlModeReading {
|
||||
const DeviceControlModeReading({required this.deviceId, this.rawMode});
|
||||
final String deviceId;
|
||||
final String? rawMode;
|
||||
|
||||
int? get value => int.tryParse(rawMode?.trim() ?? '');
|
||||
bool get hasReportedMode => rawMode?.trim().isNotEmpty == true;
|
||||
bool matches(ControlModeTarget target) => value == target.value;
|
||||
}
|
||||
Reference in New Issue
Block a user