远程遥控相关

This commit is contained in:
2026-11-06 08:34:19 +08:00
parent eb8dec2868
commit d882db7995
42 changed files with 5023 additions and 631 deletions

View File

@@ -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;
}