import 'package:vnote_device_plugin/consts/status.dart'; import 'package:vnote_device_plugin/devices/base.dart'; import 'package:vnote_device_plugin/event_type.dart'; class TempDeviceWorker extends DeviceWorkerBase { TempDeviceWorker({ required super.model, required super.mac, }) : super( "temp", maxStatus: 1003, minStatus: 1000, ); final successEvent = FEventHandler(); final errorEvent = FEventHandler(); @override void onEventCallback(int status, Map data) { if (VDeviceSdkStatus.EXAM_TEMP_ERROR == status) { errorEvent.emit(this, "Error"); //TODO: } else { //TODO: 处理过高or过低 final value = data["TEMP"]; successEvent.emit(this, value); } } }