Files
tuiche/lib/controller/mh_controller/bedController.dart
2025-12-17 17:24:00 +08:00

64 lines
1.8 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:ef/ef.dart';
import 'package:json_annotation/json_annotation.dart';
part 'bedController.g.dart'; // 由json_serializable自动生成的部分
@JsonSerializable()
class BedModel {
int patternType = 2; //1.助眠 2.手动
int noAutoPattern = -1; //1 TV 2 零重力 3 阅读 4 放平
int zhuMianPattern = -1; //1 一键放松 2 休闲模式 3腰部放松 4 腿部放松
// int anMoleftRight = 1; //1.左侧律动 2右侧律动
bool anMoStart = false; //启动按摩
bool isAnMoBei = false; //背部律动
bool isAnMoTui = false; //腿部律动
int anMoPattern = -1; //1234分别为模式1、2、3、4
double slideValue_bei = 1.0; //背部力度调节
double slideValue_tui = 1.0; //腿部力度调节
// bool isStart = false; //开启 关闭
int timerPattern = 2; //定时设置 10、20、30分钟
bool isZhuMian = false; //一键助眠开启
int zhuMainInitTime = 0;
int zhuMainRunTime = 1800; //默认床垫30分钟床为15分钟
int zhuMainRunAllTime = 1800; //默认床垫30分钟床为15分钟
int useLastTime = DateTime.now().millisecondsSinceEpoch; //最新的使用时间
String? deviceMac; // 当前选中设备mac地址
List bodyData = [
{"lastData": {}, "bodyData": []},
{"lastData": {}, "bodyData": []}
];
BedModel();
factory BedModel.fromJson(Map<String, dynamic> json) {
try {
return _$BedModelFromJson(json);
} catch (e) {
return BedModel();
}
}
Map<String, dynamic> toJson() => _$BedModelToJson(this);
}
class BedController extends GetControllerEx<BedModel> {
// WebsocketProp? websocketProp;
// ble.ConnectedDeviceProp? deviceProp;
// GlobalController get glcontroller => Get.find<GlobalController>();
Function? calibrationListenCall;
List pinlvTimerList = [null, null];
BedController() {
attr = GetModel(BedModel()).obs;
}
}