Files
ai_chat_assistant/lib/services/vehicle_state_service.dart
Chen Li 130755f9e1 0812
2025-08-12 13:36:42 +08:00

99 lines
3.4 KiB
Dart

// import 'redis_service.dart';
// import 'package:flutter_ingeek_carkey/flutter_ingeek_carkey_platform_interface.dart';
// import 'package:app_car/src/app_ingeek_mdk/ingeek_mdk_instance.dart';
// import 'package:app_car/src/app_ingeek_mdk/ingeek_mdk_service.dart';
//
// class VehicleState {
// String vin;
// bool isStarted;
// bool isUnlock;
// bool isDoorUnlock;
// bool isWindowOpen;
// bool isTrunkOpen;
// int power;
// String mileage;
// String innerTemperature;
// bool climatisationOn;
// String climatisationState;
// double targetTemperature;
// bool wheelHeatOn;
// bool mainSeatHeatOn;
// bool minorSeatHeatOn;
//
// VehicleState({
// required this.vin,
// required this.isStarted,
// required this.isUnlock,
// required this.isDoorUnlock,
// required this.isWindowOpen,
// required this.isTrunkOpen,
// required this.power,
// required this.mileage,
// required this.innerTemperature,
// required this.climatisationOn,
// required this.climatisationState,
// required this.targetTemperature,
// required this.wheelHeatOn,
// required this.mainSeatHeatOn,
// required this.minorSeatHeatOn,
// });
//
// Map<String, dynamic> toJson() => {
// "vin": vin,
// "isStarted": isStarted,
// "isUnlock": isUnlock,
// "isDoorUnlock": isDoorUnlock,
// "isWindowOpen": isWindowOpen,
// "isTrunkOpen": isTrunkOpen,
// "power": power,
// "mileage": mileage,
// "innerTemperature": innerTemperature,
// "climatisationOn": climatisationOn,
// "climatisationState": climatisationState,
// "targetTemperature": targetTemperature,
// "wheelHeatOn": wheelHeatOn,
// "mainSeatHeatOn": mainSeatHeatOn,
// "minorSeatHeatOn": minorSeatHeatOn,
// };
// }
//
// class VehicleStateService {
// MDKObserverClient? _mdkClient;
// String vin = '';
//
// static final VehicleStateService _instance = VehicleStateService._internal();
//
// factory VehicleStateService() => _instance;
//
// VehicleStateService._internal() {
// _mdkClient = InGeekMdkInstance().addObserve(
// (IGKVehicleStatusInfo data) {
// vin = data.vin;
// final vehicleState = VehicleState(
// vin: data.vin,
// isStarted: InGeekMdkInstance().getCarIsStart(),
// isUnlock: InGeekMdkInstance().getMDKCarIsUnLock(),
// isDoorUnlock: InGeekMdkInstance().getMDKDoorIsUnLock(),
// isWindowOpen: InGeekMdkInstance().getMDKWindowIsOpen(),
// isTrunkOpen: InGeekMdkInstance().getMDKTrunkIsOpen(),
// power: InGeekMdkInstance().getMDKPower(),
// mileage: InGeekMdkInstance().getMDKMileage(),
// innerTemperature: InGeekMdkInstance().getMdkInnerTemperature(),
// climatisationOn: InGeekMdkInstance().getMdkClimatizationOnoff(),
// climatisationState: InGeekMdkInstance().getMdkClimatisationState(),
// targetTemperature: InGeekMdkInstance().getMdkTargetTemperature(),
// wheelHeatOn: InGeekMdkInstance().getMdkWheelHeatOn(),
// mainSeatHeatOn: InGeekMdkInstance().getMdkMainSeatHeatOn(),
// minorSeatHeatOn: InGeekMdkInstance().getMdkMinorSeatHeatOn());
// RedisService().setKeyValue(data.vin, vehicleState);
// },
// );
// }
//
// void dispose() {
// if (_mdkClient != null) {
// InGeekMdkInstance().removeObserve(_mdkClient!);
// }
// }
// }