Commit be1b16cd authored by 张宏's avatar 张宏

333333333

parent 96e4c909
......@@ -925,19 +925,8 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
alarmId: alarm.alarmId,
);
// 按告警标题去重:相同标题 → 原地覆盖;不同标题 → 插入头部
final existingIndex = state.cameraAlerts.indexWhere((a) => a.title == title);
if (existingIndex >= 0) {
// 已存在相同标题 → 原地替换
final updatedAlerts = List<AlertInfoBO>.from(state.cameraAlerts);
updatedAlerts[existingIndex] = alert;
emit(state.copyWith(cameraAlerts: updatedAlerts));
} else {
// 不存在 → 插入头部
emit(state.copyWith(
cameraAlerts: [alert, ...state.cameraAlerts],
));
}
// 摄像头告警只保留最新一条,新消息直接覆盖
emit(state.copyWith(cameraAlerts: [alert]));
}
/// 处理 MQTT pet/bind 宠物绑定消息
......@@ -1024,7 +1013,7 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
// 温度设定值 (MQTT ×10,如 260 → 26.0℃)
case 'temperatureSetting':
final temp = (value / 10).toStringAsFixed(1);
bloc.setCabinTempSetValue(temp);
bloc.setCabinTempSetValue(temp.toString());
break;
// 湿度设定值
......@@ -1066,13 +1055,13 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
);
break;
// 照明灯:0=关 / 1=开
case 'floodLight':
// 检查灯:0=关 / 1=开
case 'inspectionLamp':
bloc.setIlluminationLightSwitch(value == 1);
break;
// 泛光灯/检查灯:0=关 / 1=开
case 'inspectionLamp':
// 照明灯/检查灯:0=关 / 1=开
case 'floodLight':
bloc.setCheckLightSwitch(value == 1);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment